Update categories/templatetags/category_tags.py

Added NoneType check to display_drilldown_as_ul on line 188 to fix NoneType error.
This commit is contained in:
Glen 2013-02-24 23:16:53 -08:00
parent 59c3e27134
commit fb6fb4e6f5

View file

@ -184,7 +184,10 @@ def display_drilldown_as_ul(category, using='categories.Category'):
</ul>
"""
cat = get_category(category, using)
return {'category': cat, 'path': drilldown_tree_for_node(cat) or []}
if cat is None:
return {'category': cat, 'path': []}
else:
return {'category': cat, 'path': drilldown_tree_for_node(cat)}
@register.inclusion_tag('categories/ul_tree.html')