From 2bf7655404a4f4e2f1a04a6a524caeb385e9c5a1 Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Sat, 21 Mar 2020 19:18:24 +0100 Subject: [PATCH] v4.1.0.0 https://haproxy-wi.org/changelog.py#4_1 --- app/sql.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/sql.py b/app/sql.py index ff7650f8..795df584 100644 --- a/app/sql.py +++ b/app/sql.py @@ -461,7 +461,10 @@ def get_user_name_by_uuid(uuid): def get_user_role_by_uuid(uuid): con, cur = get_cur() try: - 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,)) + 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,)) except sqltool.Error as e: funct.out_error(e) else: