From 78bee4ec778947df35fa47e29282a60aec5a7acd Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sun, 23 May 2021 20:23:54 +0000 Subject: threads etc --- apioforum/auth.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apioforum/auth.py') diff --git a/apioforum/auth.py b/apioforum/auth.py index fe03264..49808ea 100644 --- a/apioforum/auth.py +++ b/apioforum/auth.py @@ -75,9 +75,14 @@ def load_user(): if username is None: g.user = None else: - g.user = get_db().execute( + row = get_db().execute( "SELECT * FROM users WHERE username = ?;", (username,) ).fetchone() + if row is None: + g.user = None + else: + g.user = row['username'] + def login_required(view): @functools.wraps(view) -- cgit v1.2.3