diff options
author | Markku Okkonen <mokkonen@local> | 2023-11-10 15:06:45 +0200 |
---|---|---|
committer | Markku Okkonen <mokkonen@local> | 2023-11-10 15:06:45 +0200 |
commit | 8128427a1d667f62ce4888fe2921ca12b6823deb (patch) | |
tree | d24c9f58e3980bc49ca45fece0cceffe9baa3b5d /routes.py | |
parent | fcb6ffc64fa8cf3b57d5960fb75d10107b346e46 (diff) |
Database basics and initial workings of nick registeration
Diffstat (limited to 'routes.py')
-rw-r--r-- | routes.py | 29 |
1 files changed, 20 insertions, 9 deletions
@@ -1,30 +1,41 @@ from app import app from flask import render_template,session +def get_alert(): + if "alert" in session: + alert = session["alert"] + del session["alert"] + return f"{alert}" + return "" + + + @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/pages/info.html") def info(): - return render_template("info.html") + return render_template("info.html", alert=get_alert() ) @app.route("/pages/create.html") def create(): - if "nick" not in session: - return render_template("nick.html") - return render_template("create.html") + if "id" not in session: + return render_template("nick.html", alert=get_alert() ) + return render_template("create.html", alert=get_alert() ) @app.route("/pages/answer.html") def answer(): - if "nick" not in session: - return render_template("nick.html") - return render_template("answer.html") + if "id" not in session: + return render_template("nick.html", alert=get_alert() ) + return render_template("answer.html", alert=get_alert() ) @app.route("/pages/analyse.html") def analyse(): - return render_template("analyse.html") + if "id" not in session: + return render_template("nick.html", alert=get_alert() ) + return render_template("analyse.html", alert=get_alert() ) @app.route("/pages/moderate.html") def moderate(): - return render_template("moderate.html") + return render_template("moderate.html", alert=get_alert() ) |