Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
protokollsystem
proto3
Commits
80c2be61
Commit
80c2be61
authored
Apr 12, 2018
by
Robin Sonnabend
Browse files
Remove ambiguity if the user is logged in or None
parent
d9926168
Changes
1
Hide whitespace changes
Inline
Side-by-side
shared.py
View file @
80c2be61
...
@@ -136,11 +136,13 @@ security_manager = SecurityManager(config.SECURITY_KEY, max_duration)
...
@@ -136,11 +136,13 @@ security_manager = SecurityManager(config.SECURITY_KEY, max_duration)
def
check_login
():
def
check_login
():
return
"auth"
in
session
and
security_manager
.
check_user
(
session
[
"auth"
])
return
current_user
()
is
not
None
def
current_user
():
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
None
return
User
.
from_hashstring
(
session
[
"auth"
])
return
User
.
from_hashstring
(
session
[
"auth"
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment