1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-12-20 23:41:20 +00:00

Redirect first login to docs

This commit is contained in:
Mo 2022-05-30 18:09:19 +02:00
parent 3ad255b1dc
commit a163cb3be7

View file

@ -16,9 +16,19 @@ def util_processor():
@app.route("/") @app.route("/")
def index(): def index():
if current_user.has_role("admin"): if current_user.has_role("admin"):
return redirect(url_for("index") + "admin") url = url_for("index") + "admin"
if current_user.login_count == 1:
url += "/docs"
return redirect(url)
elif current_user.has_role("assistant"): elif current_user.has_role("assistant"):
return redirect(url_for("index") + "assistant") url = url_for("index") + "assistant"
if current_user.login_count == 1:
url += "/docs"
return redirect(url)
else: else:
return redirect(url_for("security.login")) return redirect(url_for("security.login"))