summaryrefslogtreecommitdiffhomepage
path: root/apioforum/auth.py
diff options
context:
space:
mode:
authorubq323 <ubq323>2021-05-23 20:23:54 +0000
committerubq323 <ubq323>2021-05-23 20:23:54 +0000
commit78bee4ec778947df35fa47e29282a60aec5a7acd (patch)
tree533cd1e3b9aad1e84aa0fe21dea8ecac177a2550 /apioforum/auth.py
parenteb298f0c63eb6ac5547a6a7a0086e5e086ad5abc (diff)
threads etc
Diffstat (limited to 'apioforum/auth.py')
-rw-r--r--apioforum/auth.py7
1 files changed, 6 insertions, 1 deletions
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)