From a0f4addebf0758be9dbfcc1330964221b23c8641 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Wed, 4 Nov 2015 23:37:31 +0100 Subject: [PATCH] Use smarter ersion of get_templates and get_paginate_by --- djangocms_blog/views.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/djangocms_blog/views.py b/djangocms_blog/views.py index 5bb995f..758130e 100644 --- a/djangocms_blog/views.py +++ b/djangocms_blog/views.py @@ -46,10 +46,8 @@ class BaseBlogView(AppConfigMixin, ViewUrlMixin): return queryset def get_template_names(self): - if self.config.template_prefix: - return os.path.join(self.config.template_prefix, self.base_template_name) - else: - return os.path.join('djangocms_blog', self.base_template_name) + template_path = self.config.template_prefix or 'djangocms_blog' + return os.path.join(template_path, self.base_template_name) class PostListView(BaseBlogView, ListView): @@ -64,10 +62,7 @@ class PostListView(BaseBlogView, ListView): return context def get_paginate_by(self, queryset): - if self.config.paginate_by: - return self.config.paginate_by - else: - return get_setting('PAGINATION') + return self.config.paginate_by or get_setting('PAGINATION') class PostDetailView(TranslatableSlugMixin, BaseBlogView, DetailView):