Pavel Loginov 5 years ago
parent 171c5934d9
commit 2bf7655404

@ -461,6 +461,9 @@ def get_user_name_by_uuid(uuid):
def get_user_role_by_uuid(uuid): def get_user_role_by_uuid(uuid):
con, cur = get_cur() con, cur = get_cur()
try: try:
if mysql_enable == '1':
cur.execute( """ select role.id from user left join uuid as uuid on user.id = uuid.user_id left join role on role.name = user.role where uuid.uuid = '%s' """ % uuid )
else:
cur.execute("select role.id from user left join uuid as uuid on user.id = uuid.user_id left join role on role.name = user.role where uuid.uuid = ?", (uuid,)) cur.execute("select role.id from user left join uuid as uuid on user.id = uuid.user_id left join role on role.name = user.role where uuid.uuid = ?", (uuid,))
except sqltool.Error as e: except sqltool.Error as e:
funct.out_error(e) funct.out_error(e)

Loading…
Cancel
Save