From 57d79b3aa2094d721d1f28ef955194fc0600f802 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Thu, 17 Jun 2021 19:17:28 +0200 Subject: [PATCH] Add global user variable --- web_view.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web_view.py b/web_view.py index a9b5bb3..3f306f1 100755 --- a/web_view.py +++ b/web_view.py @@ -75,6 +75,10 @@ def shutdown_session(exception=None): database.session.remove() +@app.before_request +def global_user(): + g.user = flask_login.current_user._get_current_object() + def check_for_tagged_qids(qids): tagged = set() for qid in qids: