From fa296f84264693f499ff7d3a27edaa7cfc37b3c4 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 9 Jan 2019 19:59:22 +0100 Subject: [PATCH] ??? --- webserver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webserver.py b/webserver.py index 30d84e7d..84e12a9e 100644 --- a/webserver.py +++ b/webserver.py @@ -372,10 +372,10 @@ def pre_request(): fl_g.css = "nryg.less" fl_g.rygconf = config fl_g.session = db.Session() - if fl_session: - fl_g.user = None - else: + try: fl_g.user = fl_g.session.query(db.Royal).filter_by(id=fl_session["user_id"]).one_or_none() + except KeyError: + fl_g.user = None @app.after_request