From fb6fb4e6f513d0452622863b058e34c717157f5a Mon Sep 17 00:00:00 2001 From: Glen Date: Sun, 24 Feb 2013 23:16:53 -0800 Subject: [PATCH] Update categories/templatetags/category_tags.py Added NoneType check to display_drilldown_as_ul on line 188 to fix NoneType error. --- categories/templatetags/category_tags.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/categories/templatetags/category_tags.py b/categories/templatetags/category_tags.py index c39ad4c..b594e61 100644 --- a/categories/templatetags/category_tags.py +++ b/categories/templatetags/category_tags.py @@ -184,7 +184,10 @@ def display_drilldown_as_ul(category, using='categories.Category'): """ 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')