From be872c7bd289a4608ba9d421d5ed3dd4c386df5e Mon Sep 17 00:00:00 2001 From: Cristiano Urban Date: Fri, 24 Sep 2021 20:04:19 +0200 Subject: [PATCH] Added named argument to query. Signed-off-by: Cristiano Urban --- transfer_service/db_connector.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/transfer_service/db_connector.py b/transfer_service/db_connector.py index b63e7e1..52ce7c1 100644 --- a/transfer_service/db_connector.py +++ b/transfer_service/db_connector.py @@ -530,16 +530,13 @@ class DbConnector(object): 'vos_data', 'vos_group', 'vos_import') - AND (job_id ~ %s - OR job_type ~ %s - OR owner_id ~ %s - OR user_name ~ %s) + AND (job_id ~ %(str)s + OR job_type ~ %(str)s + OR owner_id ~ %(str)s + OR user_name ~ %(str)s) ORDER BY creation_time DESC; """, - (searchStr, - searchStr, - searchStr, - searchStr,)) + { 'str': searchStr }) result = cursor.fetchall() cursor.close() except Exception: -- GitLab