Skip to content

Commit

Permalink
fix the condition
Browse files Browse the repository at this point in the history
  • Loading branch information
tino097 committed Mar 26, 2018
1 parent 5795955 commit 2ac823b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ckan/lib/helpers.py
Expand Up @@ -948,8 +948,9 @@ def get_facet_items_dict(facet, limit=None, exclude_active=False):
exclude_active -- only return unselected facets.
'''
if not hasattr(c, 'search_facets'):
return c.search_facets.get(facet, {}).get('items', [])
if not hasattr(c, u'search_facets') or not c.search_facets.get(
facet, {}).get(u'items'):
return []
facets = []
for facet_item in c.search_facets.get(facet)['items']:
if not len(facet_item['name'].strip()):
Expand Down

0 comments on commit 2ac823b

Please sign in to comment.