added an commit statment to the change function

added an cp
This commit is contained in:
2000-Trek 2023-06-09 20:15:24 +02:00
parent c27d9c9e16
commit 731aa9f1f5

View file

@ -78,6 +78,7 @@ def change():
elif change == 0:
return "<p>Nothing was done!</p>"
c.execute(f"UPDATE users SET balance = balance + {change} WHERE id={user_id}")
conn.commit()
c.execute(f"SELECT * FROM users WHERE id={user_id}")
user = c.fetchall()[0][1]
return f'<p>{change} was {text} {user}</p> <a href="/list">back to the list</a>'