From 85484e91a33006b2c9b1f781b976078f58206823 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Wed, 9 Mar 2016 23:47:09 +0100 Subject: [PATCH] Views do not crash if the config is not loadable --- djangocms_blog/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/djangocms_blog/views.py b/djangocms_blog/views.py index 83bb80e..7c0ee9b 100644 --- a/djangocms_blog/views.py +++ b/djangocms_blog/views.py @@ -47,7 +47,7 @@ class BaseBlogView(AppConfigMixin, ViewUrlMixin): return queryset def get_template_names(self): - template_path = self.config.template_prefix or 'djangocms_blog' + template_path = (self.config and self.config.template_prefix) or 'djangocms_blog' return os.path.join(template_path, self.base_template_name) @@ -63,7 +63,7 @@ class PostListView(BaseBlogView, ListView): return context def get_paginate_by(self, queryset): - return self.config.paginate_by or get_setting('PAGINATION') + return (self.config and self.config.paginate_by) or get_setting('PAGINATION') class PostDetailView(TranslatableSlugMixin, BaseBlogView, DetailView):