From 1f613887143717f05983a8736ec0585216e22ec1 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sun, 22 Dec 2024 16:17:01 -0500 Subject: [PATCH] actionVal --- services/web/project/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/web/project/__init__.py b/services/web/project/__init__.py index 8ff5b43..68f4cce 100644 --- a/services/web/project/__init__.py +++ b/services/web/project/__init__.py @@ -380,10 +380,12 @@ def recent_actions(current_user): print( current_user["user"]["uid"]) user_id = current_user["user"]["id"] # FIND_USER_DETAIL= "SELECT id,uid,username,updated,email,account_name, firstname, lastname FROM members WHERE uid::text = '"+user_uid+"'" - RECENT_ACTIONS = "SELECT * FROM members_actions WHERE member_id = " + user_id + " ORDER by id DESC LIMIT 4" - with connection: + # RECENT_ACTIONS = "SELECT * FROM members_actions WHERE member_id = " + user_id + " ORDER by id DESC LIMIT 4" + RECENT_ACTIONS = "SELECT * FROM members_actions WHERE member_id = $1 ORDER by id DESC LIMIT 4" + actionVal = (user_id) + with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor: - cursor.execute(RECENT_ACTIONS) + cursor.execute(RECENT_ACTIONS,actionVal) recent_actions = cursor.fetchall() print(recent_actions)