fix KeyErrors in session
This commit is contained in:
parent
9b454b58e1
commit
4ed04fafdd
1 changed files with 2 additions and 2 deletions
|
@ -20,7 +20,7 @@ with open(environ["APP_CONFIG"]) as f:
|
|||
def login_required(func):
|
||||
@wraps(func)
|
||||
def wrapper(*args, **kwargs):
|
||||
if session["is_logged_in"]:
|
||||
if session.get("is_logged_in"):
|
||||
if try_auth(
|
||||
session["username"],
|
||||
session["password"],
|
||||
|
@ -40,7 +40,7 @@ def admin_required(func):
|
|||
@wraps(func)
|
||||
@login_required
|
||||
def wrapper(*args, **kwargs):
|
||||
if session["is_logged_in"]:
|
||||
if session.get("is_logged_in"):
|
||||
if try_auth(
|
||||
session["username"],
|
||||
session["password"],
|
||||
|
|
Loading…
Reference in a new issue