Skip to content

Commit

Permalink
Fix AttributeError exception if request doesn't have .user
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkadiy Korotaev committed May 10, 2016
1 parent bc6517b commit 633f0e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions siteblocks/siteblocksapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ def get_contents_static(self, block_alias, context):

self._cache_save()

user = context['request'].user
if user.is_authenticated():
user = getattr(context['request'], 'user', None)
if user and user.is_authenticated():
lookup_area = siteblocks_static[self.IDX_AUTH]
else:
lookup_area = siteblocks_static[self.IDX_GUEST]
Expand Down

0 comments on commit 633f0e0

Please sign in to comment.