Skip to content

Commit

Permalink
Merge pull request #4149 from tino097/helpers-flask-related-fix
Browse files Browse the repository at this point in the history
 fix an if condition to be more pythonic
  • Loading branch information
amercader committed Mar 27, 2018
2 parents ba40b55 + 7a4469c commit e6f73bc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ckan/lib/helpers.py
Expand Up @@ -948,9 +948,8 @@ def get_facet_items_dict(facet, limit=None, exclude_active=False):
exclude_active -- only return unselected facets.
'''
if not c.search_facets or \
not c.search_facets.get(facet) or \
not 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']:
Expand Down

0 comments on commit e6f73bc

Please sign in to comment.