From 56345f98cb890891534cae85dad15857917ce25d Mon Sep 17 00:00:00 2001 From: Graham Bleaney Date: Wed, 10 Jun 2020 16:31:13 -0400 Subject: [PATCH] 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. --- zerver/views/registration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/views/registration.py b/zerver/views/registration.py index 5f01cb75af..721811aec6 100644 --- a/zerver/views/registration.py +++ b/zerver/views/registration.py @@ -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: