Add an empty profile for anonymous users

It evaluates to `None`, but at least it doesn’t raise an `AttributeError` now.
This commit is contained in:
Gergely Polonkai 2018-07-26 21:46:59 +02:00
parent 7cd2156cfc
commit eaf71d4ce6

View File

@ -35,6 +35,15 @@ class AnonymousUser(BaseAnonymousUser):
return current_app.timezone
@property
def profile(self):
"""The profile of the anonymous user
Always evaluates to ``None``
"""
return None
@user_logged_in.connect
def login_handler(app, user): # pylint: disable=unused-argument