From ad786ddff2422431df64417f3000e3071001197f Mon Sep 17 00:00:00 2001 From: 2000-Trek Date: Tue, 19 Sep 2023 22:23:55 +0200 Subject: [PATCH] error.html template --- Website/__init__.py | 20 +++++++++++--------- Website/templates/adduser.html | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Website/__init__.py b/Website/__init__.py index 190039d..d2ea280 100644 --- a/Website/__init__.py +++ b/Website/__init__.py @@ -86,6 +86,7 @@ def create_app(test_config=None): window.location="http://matekasse.server.c3h/list" }); + Strichliste

user and tag list | Documentation

1 Credit = 1,50 Euro

Search for User:
@@ -114,6 +115,7 @@ def create_app(test_config=None): var socket = io(); """ + 'socket.on("update", function(){ window.location="http://matekasse.server.c3h/list/user?id=' + id + '"});' + f""" + {escape(user[1])}

user and tag list | Documentation

{escape(user[1])} : {user[2]}

@@ -128,7 +130,7 @@ def create_app(test_config=None): """ else: - return "Error: 043" + return render_template("error.html", error_code="043") @app.route("/adduser") def new_user(): @@ -149,9 +151,9 @@ def create_app(test_config=None): app.logger.info(f"Deleted user ?", [user_id]) db.commit() socketio.emit("update", "update") - return f'

user and tag list | Documentation

Deleted user {escape(user_name)}

return to the tags and user list

' + return f'remove user

user and tag list | Documentation

Deleted user {escape(user_name)}

return to the tags and user list

' else: - return "Error: 043" + return render_template("error.html", error_code="043") @app.route("/adduser/user", methods=['GET']) def adduser(): @@ -159,7 +161,7 @@ def create_app(test_config=None): c = db.cursor() username = request.args.get("username") if username == None: - return "418" + return render_template("error.html", error_code="418") c.execute("SELECT * FROM users WHERE username=?", [username]) if c.fetchall() == []: c.execute("INSERT or IGNORE INTO users (username, balance) VALUES (?, 0)", [username]) @@ -177,7 +179,7 @@ def create_app(test_config=None): """ else: - return '

user and tag list | Documentation

Error: 757

' + return render_template("error.html", error_code="757") @app.route("/change", methods=['GET']) @@ -188,7 +190,7 @@ def create_app(test_config=None): user_id = request.args.get("id") change = int(request.args.get("change")) except: - return '

Error: 095

tags and user list' + return render_template("error.html", error_code="095") c.execute(f"SELECT * FROM users WHERE id=?", [user_id]) users = c.fetchall() if users != []: @@ -207,14 +209,14 @@ def create_app(test_config=None): """ else: - return '

user and tag list | Documentation

Error: 043

' + return render_template("error.html", error_code="043") @app.route("/addtag", methods=['GET']) def get_addtag_request(): try: user_id = int(request.args.get("id")) except: #except im Normalen Code! - return "Error: 095" + return render_template("error.html", error_code="095") session_id = uuid.uuid4() session[id] = session_id user_queue.put([user_id, "add", session_id]) @@ -252,7 +254,7 @@ def create_app(test_config=None): try: user_id = int(request.args.get("id")) except: #except im Normalen Code! - return "Wrong user id!" + return render_template("error.html", error_code="043") session_id = uuid.uuid4() session[id] = session_id user_queue.put([user_id, "remove", session_id]) diff --git a/Website/templates/adduser.html b/Website/templates/adduser.html index e71c038..2782c02 100644 --- a/Website/templates/adduser.html +++ b/Website/templates/adduser.html @@ -1,5 +1,6 @@ + add user

user and tag list | Documentation

Username: