From fabac68239fec03234ea2d9101a1f2896c4f5801 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 6 Sep 2021 00:54:57 +0200 Subject: [PATCH] df --- files/helpers/wrappers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index eaccee9ea..e8f81778c 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -23,7 +23,8 @@ def get_logged_in_user(): uid = session.get("user_id") nonce = session.get("login_nonce", 0) if not uid: x= (None, 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: v = None if v and v.agendaposter_expires_utc and v.agendaposter_expires_utc < g.timestamp: v.agendaposter_expires_utc = 0