From 5e46fa10619a8b4d0e7c635658aa36ca47c8a624 Mon Sep 17 00:00:00 2001 From: citrons Date: Sat, 7 Aug 2021 23:43:47 +0000 Subject: fix the issue in which everything is broken --- apioforum/roles.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apioforum/roles.py b/apioforum/roles.py index bd913a0..d8e59ba 100644 --- a/apioforum/roles.py +++ b/apioforum/roles.py @@ -35,10 +35,10 @@ def get_role_config(forum_id, role): return get_role_config(forum_id, "other") return the -def get_user_role(forum_id, user): +def get_user_role(forum_id, username): db = get_db() user = db.execute('SELECT * FROM users WHERE username = ?', - (user,)).fetchone() + (username,)).fetchone() if user == None: return "other" if user['admin']: return "bureaucrat" @@ -48,7 +48,7 @@ def get_user_role(forum_id, user): r = db.execute(""" SELECT * FROM role_assignments WHERE forum = ? AND user = ?; - """,(fid,user)).fetchone() + """,(fid,username)).fetchone() # the user's role is equal to the role assignnment of the closest # ancestor unless the user's role is "bureaucrat" in any ancestor # in which case, the users role is "bureaucrat" -- cgit v1.2.3