From a163cb3be72f7437464c475673050c34928e6fff Mon Sep 17 00:00:00 2001 From: Mo8it Date: Mon, 30 May 2022 18:09:19 +0200 Subject: [PATCH] Redirect first login to docs --- advlabdb/routes.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/advlabdb/routes.py b/advlabdb/routes.py index c91679e..0762a64 100644 --- a/advlabdb/routes.py +++ b/advlabdb/routes.py @@ -16,9 +16,19 @@ def util_processor(): @app.route("/") def index(): 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"): - return redirect(url_for("index") + "assistant") + url = url_for("index") + "assistant" + + if current_user.login_count == 1: + url += "/docs" + + return redirect(url) else: return redirect(url_for("security.login"))