registration: Incorporate redirect URL building helper function.

This commit adds 'add_query_to_redirect_url' to one additional
function which had not yet been written when
'add_query_to_redirect_url' was introduced. This helper centralizes
URL manipulation for redirects, making it easier to add Pysa
sanitization in subsequent commits.
This commit is contained in:
Graham Bleaney 2020-06-10 16:31:13 -04:00 committed by Tim Abbott
parent ca4357fd64
commit 56345f98cb
1 changed files with 1 additions and 1 deletions

View File

@ -444,7 +444,7 @@ def send_confirm_registration_email(email: str, activation_url: str, language: s
def redirect_to_email_login_url(email: str) -> HttpResponseRedirect:
login_url = reverse('django.contrib.auth.views.login')
email = urllib.parse.quote_plus(email)
redirect_url = login_url + '?already_registered=' + email
redirect_url = add_query_to_redirect_url(login_url, 'already_registered=' + email)
return HttpResponseRedirect(redirect_url)
def create_realm(request: HttpRequest, creation_key: Optional[str]=None) -> HttpResponse: