From 51ee6bae10c4a01b56f063c133a18c380ff3d23e Mon Sep 17 00:00:00 2001 From: Jannick Date: Mon, 29 Apr 2024 11:10:40 +0200 Subject: started integrating the database into the program --- app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index b51369c..0467dd6 100644 --- a/app.py +++ b/app.py @@ -71,8 +71,10 @@ def join_submission(db: sqlite3.Connection): raise HTTPError(400, "Preferred role must be one of the options (DPS, Tank, Healer) ( idiot )") if motivation == None or motivation.strip() == "": raise HTTPError(400, "Motivitaion field is empty or missing.") + + db.execute("SELECT * FROM applications").fetchone() - db.execute(f"INSERT INTO applications(name, role, motivation) VALUES ({name}, {preferred_role}, {motivation})") + db.execute("INSERT INTO applications(name, role, motivation) VALUES (?, ?, ?)", (name, preferred_role, motivation)) @app.route("//") def server_static(type, filename): -- cgit v1.2.3