diff --git a/categories/templatetags/category_tags.py b/categories/templatetags/category_tags.py index 07255e2..ffede0a 100644 --- a/categories/templatetags/category_tags.py +++ b/categories/templatetags/category_tags.py @@ -12,7 +12,7 @@ def get_category(category_string): """ Convert a string, including a path, and return the Category object """ - if category.startswith('"') and category.endswith('"'): + if category_string.startswith('"') and category_string.endswith('"'): category = category_string[1:-1] else: category = category_string @@ -131,4 +131,4 @@ def get_top_level_categories(parser, token): raise template.TemplateSyntaxError, "First argyment must be 'as'." return TopLevelCategoriesNode(bits[2]) -register.tag(get_top_level_categories) \ No newline at end of file +register.tag(get_top_level_categories)