From 93a927b130ba09cea29aba2077848f785ac48844 Mon Sep 17 00:00:00 2001 From: Mikko Portti Date: Thu, 16 Nov 2023 00:29:31 +0200 Subject: Fixing navigation on site in case of redirect --- routes.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'routes.py') diff --git a/routes.py b/routes.py index fde054f..b38cf3c 100644 --- a/routes.py +++ b/routes.py @@ -7,8 +7,6 @@ def get_alert(): del session["alert"] return f"{alert}" return "" - - @app.route("/") def index(): @@ -21,21 +19,25 @@ def info(): @app.route("/pages/create.html") def create(): if "id" not in session: - return render_template("nick.html", alert=get_alert() ) + return "redirect = #nick" return render_template("create.html", alert=get_alert() ) @app.route("/pages/answer.html") def answer(): if "id" not in session: - return render_template("nick.html", alert=get_alert() ) + return "redirect = #nick" return render_template("answer.html", alert=get_alert() ) @app.route("/pages/analyse.html") def analyse(): if "id" not in session: - return render_template("nick.html", alert=get_alert() ) + return "redirect = #nick" return render_template("analyse.html", alert=get_alert() ) @app.route("/pages/moderate.html") def moderate(): return render_template("moderate.html", alert=get_alert() ) + +@app.route("/pages/nick.html") +def nick(): + return render_template("nick.html", alert=get_alert() ) -- cgit v1.2.3