From ab4cf2a2a809113dc71170a58d0106503dcaf13d Mon Sep 17 00:00:00 2001 From: Max Value Date: Thu, 6 Mar 2025 23:02:54 +0000 Subject: [PATCH] changed query to not incl backslash char --- teleshopping.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/teleshopping.py b/teleshopping.py index fd65974..4f35c63 100755 --- a/teleshopping.py +++ b/teleshopping.py @@ -105,9 +105,10 @@ def admin_page(page): valid_data = {k: type_note[k].__call__(aggrigate_data[k]) for k in aggrigate_data if k in type_note} + data_list = ', '.join([f"{k} = '{v}'" if type(v) == str else f"{k} = {v}" for (k,v) in valid_data.items()]) query = f""" UPDATE state SET - {', '.join([f'{k} = \'{v}\'' if type(v) == str else f'{k} = {v}' for (k,v) in valid_data.items()])} + {data_list} WHERE id = 1; """ -- 2.39.2