From e0ca9caf5a49981ad999b1c0c3fec69d7c4871e4 Mon Sep 17 00:00:00 2001 From: Minea Salmimaa Date: Sun, 3 Dec 2023 12:44:45 +0200 Subject: Moving quiz related db actions to separete class and file. --- routes/answer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'routes/answer.py') 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/") 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"]) -- cgit v1.2.3