Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

registration: Re-use the redirect_to_email_login_url helper.

Alex Vandiver08d716c74175
diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py
index d1df0d2826c..75fcfb9da08 100644
--- a/zerver/tests/test_signup.py
+++ b/zerver/tests/test_signup.py
@@ -1704,7 +1704,7 @@ so we didn't send them an invitation. We did send invitations to everyone else!"
response = self.client_post(url, {"key": registration_key, "from_confirmation": 1, "full_name": "alice"})
self.assertEqual(response.status_code, 302)
self.assertEqual(response.url, reverse('login') + '?' +
- urlencode({"email": email}))
+ urlencode({"email": email, "already_registered": 1}))
class InvitationsTestCase(InviteUserBase):
def test_do_get_user_invites(self) -> None:
diff --git a/zerver/views/registration.py b/zerver/views/registration.py
index ec0e116f44d..7916b9617e6 100644
--- a/zerver/views/registration.py
+++ b/zerver/views/registration.py
@@ -163,9 +163,7 @@ def accounts_register(request: HttpRequest) -> HttpResponse:
try:
validate_email_not_already_in_realm(realm, email)
except ValidationError:
- view_url = reverse('login')
- redirect_url = add_query_to_redirect_url(view_url, urlencode({"email": email}))
- return HttpResponseRedirect(redirect_url)
+ return redirect_to_email_login_url(email)
name_validated = False
full_name = None