Merge "Address RemovedInDjango40Warning"

This commit is contained in:
Zuul 2022-04-12 10:58:19 +00:00 committed by Gerrit Code Review
commit fcf3ae9365

View File

@ -447,8 +447,9 @@ def switch_system_scope(request, redirect_field_name=auth.REDIRECT_FIELD_NAME):
# Ensure the user-originating redirection url is safe.
# Taken from django.contrib.auth.views.login()
redirect_to = request.GET.get(redirect_field_name, '')
if not http.is_safe_url(url=redirect_to,
allowed_hosts=[request.get_host()]):
if (not http.url_has_allowed_host_and_scheme(
url=redirect_to,
allowed_hosts=[request.get_host()])):
redirect_to = settings.LOGIN_REDIRECT_URL
if auth_ref: