fast fix
This commit is contained in:
parent
c710fe7a78
commit
6464c0538e
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user