Merge pull request #181 from nephila/feature/fix_config

Fix error when no config is found
This commit is contained in:
Iacopo Spalletti 2015-12-20 18:38:35 +01:00
commit ebf759ec70

View file

@ -25,9 +25,9 @@ class BlogCategoryMenu(CMSAttachMenu):
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: