Move logged-in redirect to beginning of view
This commit is contained in:
parent
74a04b6750
commit
a118812661
@ -18,6 +18,9 @@ bp = Blueprint("atst", __name__)
|
|||||||
|
|
||||||
@bp.route("/")
|
@bp.route("/")
|
||||||
def root():
|
def root():
|
||||||
|
if g.current_user:
|
||||||
|
return redirect(url_for(".home"))
|
||||||
|
|
||||||
redirect_url = app.config.get("CAC_URL")
|
redirect_url = app.config.get("CAC_URL")
|
||||||
if request.args.get("next"):
|
if request.args.get("next"):
|
||||||
redirect_url = url.urljoin(
|
redirect_url = url.urljoin(
|
||||||
@ -25,9 +28,6 @@ def root():
|
|||||||
"?{}".format(url.urlencode({"next": request.args.get("next")})),
|
"?{}".format(url.urlencode({"next": request.args.get("next")})),
|
||||||
)
|
)
|
||||||
|
|
||||||
if g.current_user:
|
|
||||||
return redirect(url_for(".home"))
|
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
"login.html", redirect=bool(request.args.get("next")), redirect_url=redirect_url
|
"login.html", redirect=bool(request.args.get("next")), redirect_url=redirect_url
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user