mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 09:38:25 -04:00
Moved condition back to top of method
This commit is contained in:
@@ -203,6 +203,11 @@ def _handle_e2e_tests(redirect_url): # pragma: no cover
|
|||||||
@main.route("/sign-in", methods=(["GET", "POST"]))
|
@main.route("/sign-in", methods=(["GET", "POST"]))
|
||||||
@hide_from_search_engines
|
@hide_from_search_engines
|
||||||
def sign_in(): # pragma: no cover
|
def sign_in(): # pragma: no cover
|
||||||
|
redirect_url = request.args.get("next")
|
||||||
|
|
||||||
|
if os.getenv("NOTIFY_E2E_TEST_EMAIL"):
|
||||||
|
return _handle_e2e_tests(redirect_url)
|
||||||
|
|
||||||
# If we have to revalidated the email, send the message
|
# If we have to revalidated the email, send the message
|
||||||
# via email and redirect to the "verify your email page"
|
# via email and redirect to the "verify your email page"
|
||||||
# and don't proceed further with login
|
# and don't proceed further with login
|
||||||
@@ -214,11 +219,6 @@ def sign_in(): # pragma: no cover
|
|||||||
):
|
):
|
||||||
return email_verify_template
|
return email_verify_template
|
||||||
|
|
||||||
redirect_url = request.args.get("next")
|
|
||||||
|
|
||||||
if os.getenv("NOTIFY_E2E_TEST_EMAIL"):
|
|
||||||
return _handle_e2e_tests(redirect_url)
|
|
||||||
|
|
||||||
if current_user and current_user.is_authenticated:
|
if current_user and current_user.is_authenticated:
|
||||||
if redirect_url and is_safe_redirect_url(redirect_url):
|
if redirect_url and is_safe_redirect_url(redirect_url):
|
||||||
return redirect(redirect_url)
|
return redirect(redirect_url)
|
||||||
|
|||||||
Reference in New Issue
Block a user