From 6464c0538e7907432a6bad295400aafe69265dd7 Mon Sep 17 00:00:00 2001 From: Yapollon Date: Fri, 2 Feb 2024 09:28:36 +0100 Subject: [PATCH] fast fix --- db/SQLiteClient.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/SQLiteClient.py b/db/SQLiteClient.py index 068541c..d6e0481 100644 --- a/db/SQLiteClient.py +++ b/db/SQLiteClient.py @@ -45,9 +45,9 @@ def get_user_by_email(email: str): def update_user(id: int, name: str, email: str, password: str = None): now = datetime.now().isoformat() if password: - query = f"UPDATE users SET name = '{name}', email = '{email}', password = '{password}', updated_at = {now} WHERE id = {id};" + query = f"UPDATE users SET name = '{name}', email = '{email}', password = '{password}', updated_at = '{now}' WHERE id = {id};" else: - query = f"UPDATE users SET name = '{name}', email = '{email}', updated_at = {now} WHERE id = {id};" + query = f"UPDATE users SET name = '{name}', email = '{email}', updated_at = '{now}' WHERE id = {id};" conn = con3() cursor = conn.cursor() cursor.execute(query) @@ -144,7 +144,7 @@ def get_slots(user_id: int): def update_slot(id: int, slot: int): now = datetime.now().isoformat() - query = f"UPDATE habits SET slot = {slot}, updated_at = {now} WHERE id = {id};" + query = f"UPDATE habits SET slot = {slot}, updated_at = '{now}' WHERE id = {id};" conn = con3() cursor = conn.cursor() cursor.execute(query) @@ -155,7 +155,7 @@ def update_slot(id: int, slot: int): def update_habit(id: int, name: str, note: str, times: int, unit: int): now = datetime.now().isoformat() - query = f"UPDATE habits SET name = {name}, note = {note}, times = {times}, unit = {unit}, updated_at = {now} WHERE id = {id};" + query = f"UPDATE habits SET name = {name}, note = {note}, times = {times}, unit = {unit}, updated_at = '{now}' WHERE id = {id};" conn = con3() cursor = conn.cursor() cursor.execute(query)