forked from gergely/calendar-social
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:
parent
7cd2156cfc
commit
eaf71d4ce6
@ -35,6 +35,15 @@ class AnonymousUser(BaseAnonymousUser):
|
|||||||
|
|
||||||
return current_app.timezone
|
return current_app.timezone
|
||||||
|
|
||||||
|
@property
|
||||||
|
def profile(self):
|
||||||
|
"""The profile of the anonymous user
|
||||||
|
|
||||||
|
Always evaluates to ``None``
|
||||||
|
"""
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
@user_logged_in.connect
|
@user_logged_in.connect
|
||||||
def login_handler(app, user): # pylint: disable=unused-argument
|
def login_handler(app, user): # pylint: disable=unused-argument
|
||||||
|
Loading…
Reference in New Issue
Block a user