Commit 88838c84 authored by fred's avatar fred
Browse files

search: ignore malformed facets

parent 6ef24005
......@@ -139,10 +139,10 @@ class SearchView(FacetedSearchView):
context['facets_qs'] = '&selected_facets=' + '&'.join(self.request.GET.getlist('selected_facets'))
context['selected_categories'] = [
x.split(':', 1)[1] for x in self.request.GET.getlist('selected_facets')
if x.startswith('categories_exact')]
if x.startswith('categories_exact') and ':' in x]
context['selected_tags'] = [
x.split(':', 1)[1] for x in self.request.GET.getlist('selected_facets')
if x.startswith('tags_exact')]
if x.startswith('tags_exact') and ':' in x]
if 'categories' in context['facets'].get('fields', []):
context['facets']['fields']['categories'] = [x for x in
context['facets']['fields']['categories'] if x[1] > 0]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment