added an commit statment to the change function
added an cp
This commit is contained in:
parent
c27d9c9e16
commit
731aa9f1f5
1 changed files with 1 additions and 0 deletions
1
main.py
1
main.py
|
@ -78,6 +78,7 @@ def change():
|
||||||
elif change == 0:
|
elif change == 0:
|
||||||
return "<p>Nothing was done!</p>"
|
return "<p>Nothing was done!</p>"
|
||||||
c.execute(f"UPDATE users SET balance = balance + {change} WHERE id={user_id}")
|
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}")
|
c.execute(f"SELECT * FROM users WHERE id={user_id}")
|
||||||
user = c.fetchall()[0][1]
|
user = c.fetchall()[0][1]
|
||||||
return f'<p>{change} was {text} {user}</p> <a href="/list">back to the list</a>'
|
return f'<p>{change} was {text} {user}</p> <a href="/list">back to the list</a>'
|
||||||
|
|
Loading…
Reference in a new issue