fix KeyErrors in session

This commit is contained in:
Franzi 2021-12-21 10:47:25 +01:00
parent 9b454b58e1
commit 4ed04fafdd
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -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"],