From aa9eb5068a6cdbe24cec3dc93be821c35bb779ce Mon Sep 17 00:00:00 2001 From: 2000-Trek Date: Fri, 9 Jun 2023 20:17:30 +0200 Subject: [PATCH] more bug fixing inside the change funktion --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index bbe57c0..7b85f72 100644 --- a/main.py +++ b/main.py @@ -70,18 +70,18 @@ def change(): change = int(request.args.get("change")) except ValueError: return '

Please enter a number!

tags and user list' + c.execute(f"UPDATE users SET balance = balance + {change} WHERE id={user_id}") + conn.commit() if change < 0: text = "removed from" - change = change * -1 + change_text = change * -1 elif change > 0: text = "added to" elif change == 0: return "

Nothing was done!

" - 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'

{change} was {text} {user}

back to the list' + return f'

{change_text} was {text} {user}

back to the list' @app.route("/addtag", methods=['GET']) def get_addtag_request():