Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Merge pull request #334 from trawick/get-edit-mode-exception-toolbar-…
Browse files Browse the repository at this point in the history
…unset

Fix AttributeError with aldryn-search when rebuilding index
  • Loading branch information
Kirill Kniazev committed Dec 28, 2015
2 parents 932494d + ed4ff1e commit 521bcd0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aldryn_newsblog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ def get_edit_mode(self, request):
Returns True only if an operator is logged-into the CMS and is in
edit mode.
"""
return (request.toolbar and request.toolbar.edit_mode)
return (
hasattr(request, 'toolbar') and request.toolbar and
request.toolbar.edit_mode)


class NewsBlogCMSPlugin(CMSPlugin):
Expand Down

0 comments on commit 521bcd0

Please sign in to comment.