Merge pull request #181 from nephila/feature/fix_config
Fix error when no config is found
This commit is contained in:
commit
ebf759ec70
1 changed files with 2 additions and 2 deletions
|
@ -25,9 +25,9 @@ class BlogCategoryMenu(CMSAttachMenu):
|
||||||
config = False
|
config = False
|
||||||
if hasattr(self, 'instance') and self.instance:
|
if hasattr(self, 'instance') and self.instance:
|
||||||
config = BlogConfig.objects.get(namespace=self.instance.application_namespace)
|
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
|
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
|
posts_menu = True
|
||||||
|
|
||||||
if categories_menu:
|
if categories_menu:
|
||||||
|
|
Loading…
Reference in a new issue