diff --git a/djangocms_blog/models.py b/djangocms_blog/models.py index 78d957f..0874ba3 100644 --- a/djangocms_blog/models.py +++ b/djangocms_blog/models.py @@ -227,7 +227,7 @@ class BasePostPlugin(CMSPlugin): def post_queryset(self, request): language = get_language() posts = Post._default_manager.active_translations(language_code=language) - if not request.toolbar or not request.toolbar.edit_mode: + if not getattr(request, 'toolbar', False) or not request.toolbar.edit_mode: posts = posts.published() return posts diff --git a/djangocms_blog/views.py b/djangocms_blog/views.py index 858b346..bc852c1 100644 --- a/djangocms_blog/views.py +++ b/djangocms_blog/views.py @@ -18,7 +18,7 @@ class BaseBlogView(ViewUrlMixin): def get_queryset(self): language = get_language() queryset = self.model._default_manager.active_translations(language_code=language) - if not self.request.toolbar or not self.request.toolbar.edit_mode: + if not getattr(self.request, 'toolbar', False) or not self.request.toolbar.edit_mode: queryset = queryset.published() return queryset.on_site()