From c5ed57a74ebe09097dbcf54dd8d339176b7773b3 Mon Sep 17 00:00:00 2001 From: 2000-Trek Date: Wed, 14 Jun 2023 19:48:21 +0200 Subject: [PATCH] Added confirmation to /removeuser --- main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.py b/main.py index 581de29..79c7d19 100644 --- a/main.py +++ b/main.py @@ -64,13 +64,21 @@ def user_info(): def new_user(): return render_template("adduser.html") +@app.rout("/removeuser/confirmation", methods=['GET']) +def confirm_remove_user(): + user_id = request.args.get("id") + return f'' + @app.route("/removeuser", methods=['GET']) def remove_user(): user_id = request.args.get("id") #Noch eine Bestätigung nötig + c.execute(f"SELECT * FROM users WHERE id={user_id}") + user_name = c.fetchall()[0][1] c.execute(f"DELETE FROM tags WHERE userid={user_id}") c.execute(f"DELETE FROM users WHERE id={user_id}") conn.commit() + return f'

Deleted user {user_name}

return to the tags and user list' @app.route("/adduser/user", methods=['GET']) def adduser():