fix
This commit is contained in:
@@ -101,12 +101,23 @@ for i in kanidm_users_raw:
|
|||||||
|
|
||||||
print("[DEBUG] ", users) # DEBUG
|
print("[DEBUG] ", users) # DEBUG
|
||||||
|
|
||||||
|
# Fetch RoleIDs
|
||||||
|
cur = conn.cursor()
|
||||||
|
cur.execute("SELECT id, name FROM user_roles;")
|
||||||
|
|
||||||
|
roles_raw = cur.fetchall()
|
||||||
|
roles = {}
|
||||||
|
for i in roles_raw:
|
||||||
|
roles[i[1]] = i[0]
|
||||||
|
|
||||||
|
# Give roles
|
||||||
for uid in users:
|
for uid in users:
|
||||||
if not users[uid]["isKanidmUser"]:
|
if not users[uid]["isKanidmUser"]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if users[uid]["role"]:
|
if users[uid]["role"]:
|
||||||
roleid = users[uid]["role"]
|
rolename = users[uid]["role"]
|
||||||
|
roleid = roles[rolename]
|
||||||
else:
|
else:
|
||||||
roleid = "NULL"
|
roleid = "NULL"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user