From e15e4b93c203ba94f413e97955c48d8761a70423 Mon Sep 17 00:00:00 2001 From: Unto Markkanen Date: Sun, 3 Dec 2023 12:13:04 +0200 Subject: Moving user related database commands to separate class and file. --- routes/base.py | 4 ++-- routes/tools.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'routes') diff --git a/routes/base.py b/routes/base.py index d5eae8f..a9c0e19 100644 --- a/routes/base.py +++ b/routes/base.py @@ -42,10 +42,10 @@ def new_nick(): if not nick.isalnum(): session["alert"]="Nimimerkissä saa olla vain kirjaimia ja numeroita." return redirect(next) - if D.user_exists(nick): + if D.user.exists(nick): session["alert"]="Nimimerkki jonka olet ottamassa on jo varattu." return redirect(next) - session["id"] = int(D.user_new(nick)) + session["id"] = int(D.user.new(nick)) return redirect(next) diff --git a/routes/tools.py b/routes/tools.py index 5f6e141..65aff62 100644 --- a/routes/tools.py +++ b/routes/tools.py @@ -20,7 +20,7 @@ def get_alert(): def get_nick(): while "id" in session.keys(): - nick = D.user_get_nick(session["id"]) + nick = D.user.get_nick(session["id"]) if not nick: del session['id'] if "quiz_id" in session.keys(): -- cgit v1.2.3