diff --git a/Website/__init__.py b/Website/__init__.py index 71b264c..dc82896 100644 --- a/Website/__init__.py +++ b/Website/__init__.py @@ -1,5 +1,5 @@ import queue, time, uuid, json, logging, datetime, os -from flask import Flask, render_template, request, make_response, session, send_file, g +from flask import Flask, render_template, render_template_string, request, make_response, session, send_file, g from flask_socketio import SocketIO, join_room, leave_room from flask_session import Session from markupsafe import escape @@ -10,13 +10,6 @@ preis = 1.5 #Ein Getraenk #flask_config DATABASE = './Website/mate.db' -#def create_logs(app): -# now = datetime.datetime.now().strftime('%d-%m-%Y-%H-%M-%S') -# logging.basicConfig(filename=f"logs/matekasse-{now}.log",filemode='w', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' ,encoding='utf-8', level=logging.INFO) -# app.logger = logging.getLogger('db') -# -# app.logger.info("Website is starting") - def log(type=None, userid=None, before=None, after=None): db = get_db() c = db.cursor() @@ -64,16 +57,7 @@ def create_app(test_config=None): @app.route("/") def index(): - return """ - user and tag list -
The creator of this website accepts no liability for any linguistic or technical errors!
-user and tag list | Documentation
- - -user and tag list | Documentation
-{escape(user[1])} : {escape(user[2]/100)}€
-
- - - -Tags:
- {text} -user and tag list | Documentation
Deleted user {escape(user_name)}
return to the tags and user list' + return render_template("removeuser.html", user_name=user_name) else: return render_template("error.html", error_code="043") @@ -186,15 +129,8 @@ def create_app(test_config=None): socketio.emit("update", "update") c.execute(f"SELECT * FROM users WHERE username=?", [username]) user = c.fetchone() - log(type="adduser", userid=user[0], after=user[1]) - return """ - - -tag was sucsesfully added
- - """ + return render_template("redirect.html") + else: return render_template("error.html", error_code="757") @@ -218,13 +154,7 @@ def create_app(test_config=None): user = c.fetchone() log(type="balance", userid=user[0], before=balance_old, after=user[2]) socketio.emit("update", "update") - return """ - - - - """ + return render_template("redirect.html") else: return render_template("error.html", error_code="043") @@ -288,13 +218,7 @@ def create_app(test_config=None): db.commit() message = f"Removed {tag_id} from user {user_id}" log(type="removetag", userid=user_id, before=tag_id) - return f""" - - - - """ + return render_template("redirect.html") else: return render_template("error.html", error_code="054") diff --git a/Website/templates/adduser.html b/Website/templates/adduser.html index 7368ebe..a1a74e0 100644 --- a/Website/templates/adduser.html +++ b/Website/templates/adduser.html @@ -5,4 +5,4 @@-