summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannick <[email protected]>2024-04-29 11:10:40 +0200
committerJannick <[email protected]>2024-04-29 11:10:40 +0200
commit51ee6bae10c4a01b56f063c133a18c380ff3d23e (patch)
tree1d9994cb5bc4eab219b5e3ef9ea44220f2489422
parent9f7542416748050108394cb6e51676adbc90481c (diff)
started integrating the database into the program
-rw-r--r--app.py4
1 files changed, 3 insertions, 1 deletions
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("/<type:re:styles|images>/<filename>")
def server_static(type, filename):