From eaf71d4ce6c6540366228d0a3785ff5d18455e74 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 26 Jul 2018 21:46:59 +0200 Subject: [PATCH] Add an empty profile for anonymous users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It evaluates to `None`, but at least it doesn’t raise an `AttributeError` now. --- calsocial/security.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/calsocial/security.py b/calsocial/security.py index 99ab50b..35228b1 100644 --- a/calsocial/security.py +++ b/calsocial/security.py @@ -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 -- 2.40.1