From 1c1784982a4135cc4de8438f5e4f0ff582ecd5e0 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Wed, 8 Jan 2025 10:47:18 -0500 Subject: [PATCH] getting the id --- services/web/project/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/web/project/__init__.py b/services/web/project/__init__.py index ddc5a7f..825326a 100644 --- a/services/web/project/__init__.py +++ b/services/web/project/__init__.py @@ -383,14 +383,14 @@ def complete_register(): password= data['password'] country= data['country'] - FIND_USERNAME= f"SELECT * FROM members WHERE username::text = '{username}' " + FIND_USERNAME= f"SELECT id FROM members WHERE username::text = '{username}' " print(FIND_USERNAME) with connection: with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor: cursor.execute(FIND_USERNAME) user_search = cursor.fetchall() print(user_search) - print(user_search[0]) + print(user_search[0][0]) if user_search[0]: return jsonify({'status': "DUPLICATE",'message': 'Error - use another username'}), 200