mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-11-08 21:21:06 +00:00
Redirect first login to docs
This commit is contained in:
parent
3ad255b1dc
commit
a163cb3be7
1 changed files with 12 additions and 2 deletions
|
@ -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"))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue