Merge pull request #63 from nephila/fix/toolbar
Don't presume the toolbar is there.
This commit is contained in:
commit
db12b6deb9
2 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue