diff options
author | Minea Salmimaa <msalmima@local> | 2023-12-03 12:44:45 +0200 |
---|---|---|
committer | Minea Salmimaa <msalmima@local> | 2023-12-03 12:44:45 +0200 |
commit | e0ca9caf5a49981ad999b1c0c3fec69d7c4871e4 (patch) | |
tree | 6402666bec2999dda0e1e7460b91b21e17310479 /routes/answer.py | |
parent | 7353c51df2d074cbe01913044bda7aeef62a31b7 (diff) |
Moving quiz related db actions to separete class and file.
Diffstat (limited to 'routes/answer.py')
-rw-r--r-- | routes/answer.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routes/answer.py b/routes/answer.py index 89b6aa8..f3a506c 100644 --- a/routes/answer.py +++ b/routes/answer.py @@ -5,7 +5,7 @@ from routes.tools import rows2dicts, get_alert, get_nick, csrf_check @app.route("/kys/<link>") def kys_link(link): - if aid := D.find_quiz_by_link( link ): + if aid := D.quiz.find_by_link( link ): session["answer_id"] = aid return redirect("/#answer") return redirect("/") @@ -25,7 +25,7 @@ def answer_id(): session["alert"] = "Kyselmän nimeä ei ole annettu." return redirect(next) - if aid := D.find_quiz_by_link( request.form["link"] ): + if aid := D.quiz.find_by_link( request.form["link"] ): session["answer_id"] = aid else: session["alert"] = "Koodilla ei löytynyt kyselmää" @@ -77,7 +77,7 @@ def answer(): alert = get_alert(), nick = get_nick(), questions = rows2dicts( D.get_questions(aid), ['i','q','n','p'] ), - link = D.get_quiz_link( aid ) + link = D.quiz.get_link( aid ) ) @app.route("/set/answers",methods=["POST"]) |