Commit 80c2be61 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Remove ambiguity if the user is logged in or None

parent d9926168
......@@ -136,11 +136,13 @@ security_manager = SecurityManager(config.SECURITY_KEY, max_duration)
def check_login():
return "auth" in session and security_manager.check_user(session["auth"])
return current_user() is not None
def current_user():
if not check_login():
if "auth" not in session:
return None
if not security_manager.check_user(session["auth"]):
return None
return User.from_hashstring(session["auth"])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment