Skip to content

Commit

Permalink
Fix error when no config is found
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Dec 20, 2015
1 parent 5fe7931 commit 4d7ae82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions djangocms_blog/menu.py
Expand Up @@ -25,9 +25,9 @@ def get_nodes(self, request):
config = False
if hasattr(self, 'instance') and self.instance:
config = BlogConfig.objects.get(namespace=self.instance.application_namespace)
if config.menu_structure in (MENU_TYPE_COMPLETE, MENU_TYPE_CATEGORIES):
if config and config.menu_structure in (MENU_TYPE_COMPLETE, MENU_TYPE_CATEGORIES):
categories_menu = True
if config.menu_structure in (MENU_TYPE_COMPLETE, MENU_TYPE_POSTS):
if config and config.menu_structure in (MENU_TYPE_COMPLETE, MENU_TYPE_POSTS):
posts_menu = True

if categories_menu:
Expand Down

0 comments on commit 4d7ae82

Please sign in to comment.