mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
register: Make /register redirect to find accounts in root domain without realm.
If there is no realm in the root domain don't show registration form. Instead just redirect to find accounts page.
This commit is contained in:
@@ -74,7 +74,6 @@ class DocPageTest(ZulipTestCase):
|
||||
self._test('/errors/404/', 'Page not found')
|
||||
self._test('/errors/5xx/', 'Internal server error')
|
||||
self._test('/emails/', 'manually generate most of the emails by clicking')
|
||||
self._test('/register/', 'Sign up for Zulip')
|
||||
|
||||
result = self.client_get('/integrations/doc-html/nonexistent_integration', follow=True)
|
||||
self.assertEqual(result.status_code, 404)
|
||||
|
||||
@@ -1722,6 +1722,10 @@ class UserSignUpTest(ZulipTestCase):
|
||||
self.assertIn("organization you are trying to join using {} does "
|
||||
"not exist".format(email), form.errors['email'][0])
|
||||
|
||||
def test_access_signup_page_in_root_domain_without_realm(self) -> None:
|
||||
result = self.client_get('/register', subdomain="", follow=True)
|
||||
self.assert_in_success_response(["Find your Zulip accounts"], result)
|
||||
|
||||
@override_settings(AUTHENTICATION_BACKENDS=('zproject.backends.ZulipLDAPAuthBackend',
|
||||
'zproject.backends.ZulipDummyBackend'))
|
||||
def test_ldap_registration_from_confirmation(self) -> None:
|
||||
|
||||
@@ -347,7 +347,10 @@ def confirmation_key(request):
|
||||
def accounts_home(request, multiuse_object=None):
|
||||
# type: (HttpRequest, Optional[MultiuseInvite]) -> HttpResponse
|
||||
realm = get_realm(get_subdomain(request))
|
||||
if realm and realm.deactivated:
|
||||
|
||||
if realm is None:
|
||||
return HttpResponseRedirect(reverse('zerver.views.registration.find_account'))
|
||||
if realm.deactivated:
|
||||
return redirect_to_deactivation_notice()
|
||||
|
||||
from_multiuse_invite = False
|
||||
|
||||
Reference in New Issue
Block a user