Skip to content

Commit

Permalink
The license field in solr is no longer case-insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
Bomme committed May 2, 2024
1 parent 2a43720 commit e4b7014
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions search/templatetags/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ def display_facet(context, facet_name, facet_title=None):
element['display_value'] = element['value'][element['value'].find("_")+1:]
elif element['value'] == settings.FCW_FILTER_VALUE:
element['display_value'] = "Approved for Free Cultural Works"
elif facet_name == 'license':
# License field in solr is case insensitive and will return facet names in lowercase.
# We need to properly capitalize them to use official CC license names.
element['display_value'] = element['value'].title().replace('Noncommercial', 'NonCommercial')
elif facet_type == 'range':
# Update display value for range facets
gap = sqp.facets[facet_name]['gap']
Expand Down Expand Up @@ -157,4 +153,4 @@ def display_search_option(context, option_name, widget=None):
search_query_processor_options.SearchOptionChoice: 'select',
}.get(type(option), 'text')
label = option.label if option.label else option_name.capitalize().replace('_', ' ')
return {'option': option, 'option_name': option_name, 'label': label, 'widget': widget}
return {'option': option, 'option_name': option_name, 'label': label, 'widget': widget}

0 comments on commit e4b7014

Please sign in to comment.