summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcitrons <citrons>2021-08-07 23:43:47 +0000
committercitrons <citrons>2021-08-07 23:43:47 +0000
commit5e46fa10619a8b4d0e7c635658aa36ca47c8a624 (patch)
tree07ccdd0849df776b3a5d72d087b5722e92b1b52e
parent09f38fd67bae05c7998ab9573d5842d02df247d8 (diff)
fix the issue in which everything is broken
-rw-r--r--apioforum/roles.py6
1 files 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"