From e830c42727dd4792d9256f2c44e2d1d206c3756f Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sun, 22 Dec 2024 16:21:17 -0500 Subject: [PATCH] Fix query --- services/web/project/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/services/web/project/__init__.py b/services/web/project/__init__.py index 68f4cce..81f2251 100644 --- a/services/web/project/__init__.py +++ b/services/web/project/__init__.py @@ -383,11 +383,10 @@ def recent_actions(current_user): # 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,actionVal) - recent_actions = cursor.fetchall() - print(recent_actions) + with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor: + cursor.execute(RECENT_ACTIONS,actionVal) + recent_actions = cursor.fetchall() + print(recent_actions) action_data = { "recent_actions" : recent_actions,