From 5c9206a59a0e2675d50939acec3228b249c08cde Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 17 Dec 2021 07:21:55 +0200 Subject: [PATCH] fdsfsd --- files/helpers/wrappers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index 50dabecda..4bcf4dfaa 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -21,7 +21,9 @@ def get_logged_in_user(): if not uid: return None # if not uid or not logged_in or uid != logged_in: return None - v = g.db.query(User).filter_by(id=uid).first() + if g.db: v = g.db.query(User).filter_by(id=uid).first() + else: return None + if not v or nonce < v.login_nonce: return None v.client = None