diff --git a/main.py b/main.py index 06aa8b0..c765c1c 100644 --- a/main.py +++ b/main.py @@ -68,8 +68,12 @@ def new_user(): def remove_user(): user_id = request.args.get("id") #Noch eine Bestätigung nötig - c.execute(f"DELETE * FROM tags WHERE userid={user_id}") - c.execute(f"DELETE * FROM users WHERE id={user_id}") + c.execute(f"SELECT * FROM tags WHERE userid={user_id}") + if c.fetchall != []: + c.execute(f"DELETE * FROM tags WHERE userid={user_id}") + c.execute(f"SELECT * FROM useres WHERE id={user_id}") + if c.fetchall != []: + c.execute(f"DELETE * FROM users WHERE id={user_id}") conn.commit() @app.route("/adduser/user", methods=['GET'])