From 37c39437c95f4553f078fb86f7ae799d55dfb3d7 Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Mon, 20 Jan 2025 17:54:23 +0700 Subject: [PATCH] Fixing a false table name and uncompleted variable calling on procedure --- procedure/validation.py | 6 ++---- procedure/webmail.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/procedure/validation.py b/procedure/validation.py index 1b8bede..908d016 100644 --- a/procedure/validation.py +++ b/procedure/validation.py @@ -19,10 +19,8 @@ class validation(): result_profile = self.cursor.fetchone() self.cursor.execute("SELECT COUNT(*) AS `count` FROM auth_profile WHERE username = %s ; ", (username,) ) result_username = self.cursor.fetchone() - self.cursor.execute(f"SELECT COUNT(*) AS `count` FROM auth_profile_verification INNER JOIN auth_profile ON auth_profile.id = auth_profile_verification.auth_profile WHERE auth_profile.email = %s AND auth_profile_verification.type = 'email' AND auth_profile_verification.verified = 0 ; ", (email,) ) + self.cursor.execute(f"SELECT COUNT(*) AS `count` FROM auth_profile_verification INNER JOIN auth_profile ON auth_profile.id = auth_profile_verification.profile WHERE auth_profile.email = %s AND auth_profile_verification.type = 'email' AND auth_profile_verification.verified = 0 ; ", (email,) ) result_unverified = self.cursor.fetchone() - self.cursor.execute(f"SELECT id, name FROM `auth_roles` WHERE auth_roles.name = %s ; ", (roles,) ) - result_roles = self.cursor.fetchone() loggorilla.prcss(APIADDR, "Validating") if score < 0.2: response["status" ] = "failed" @@ -120,7 +118,7 @@ class validation(): } else: session_not_found = False - cursor.execute(f"SELECT COUNT(*) AS `count`, auth_profile.* FROM auth_profile_verification LEFT JOIN auth_profile ON auth_profile.id = auth_profile_verification.auth_profile WHERE auth_profile.token = %s AND auth_profile_verification.type = 'email' AND auth_profile_verification.verified = 1 ; ", (r_session['token'],) ) + cursor.execute(f"SELECT COUNT(*) AS `count`, auth_profile.* FROM auth_profile_verification LEFT JOIN auth_profile ON auth_profile.id = auth_profile_verification.profile WHERE auth_profile.token = %s AND auth_profile_verification.type = 'email' AND auth_profile_verification.verified = 1 ; ", (r_session['token'],) ) r_profile = cursor.fetchone() cursor.execute(f"SELECT auth_roles FROM auth_profile_roles WHERE auth_profile = %s ; ", (r_profile['id'],) ) r_roles = cursor.fetchall() diff --git a/procedure/webmail.py b/procedure/webmail.py index d5d900e..534412f 100644 --- a/procedure/webmail.py +++ b/procedure/webmail.py @@ -9,7 +9,7 @@ class webmail(): def verification(self, APIADDR, params, data): return { "subject" : f"{globalvar.title} email verification", - "text" : f"Please visit this link to complete the registration: {data['verify']}. You are not registering this? report on this: {data['notme'].", + "text" : f"Please visit this link to complete the registration: {data['verify']} . You are not registering this? report on this: {data['notme']} .", "html" : Template(params["mako"]["email"]['index']).render( title = globalvar.title, header = globalvar.title,