From 9b414339ca3c5c5278c61ea1884809d944301573 Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Wed, 3 Sep 2025 14:15:23 +0700 Subject: [PATCH] Simplify query --- modules/api/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/api/auth.py b/modules/api/auth.py index 6613bc8..f80218f 100644 --- a/modules/api/auth.py +++ b/modules/api/auth.py @@ -33,7 +33,7 @@ class auth: self.cursor.execute("BEGIN;") try: loggorilla.prcss(APIADDR, "Get dependency data") - self.cursor.execute(f"SELECT id, name FROM `auth_roles` WHERE auth_roles.name = %s ; ", (roles,) ) + self.cursor.execute(f"SELECT `id` FROM `auth_roles` WHERE `name` = %s ;", (roles,) ) result_roles = self.cursor.fetchone() loggorilla.prcss(APIADDR, "Process parameters") hashed = bcrypt.hashpw(password.encode(), bcrypt.gensalt()).decode()