From 4d7ae8275f75d52aac77410027cd00774dc8c2ee Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sun, 20 Dec 2015 17:09:16 +0100 Subject: [PATCH] Fix error when no config is found --- djangocms_blog/menu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/djangocms_blog/menu.py b/djangocms_blog/menu.py index 6b4e883..036811e 100644 --- a/djangocms_blog/menu.py +++ b/djangocms_blog/menu.py @@ -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: