Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
confirmation: Rename REALM_CREATION to NEW_REALM_USER_REGISTRATION.
Mateusz Mandera072f23426912
diff --git a/confirmation/models.py b/confirmation/models.pyindex f0bd55c0a8a..7dfbd7ac214 100644--- a/confirmation/models.py+++ b/confirmation/models.py@@ -232,7 +232,7 @@ class Confirmation(models.Model):UNSUBSCRIBE = 4SERVER_REGISTRATION = 5MULTIUSE_INVITE = 6- REALM_CREATION = 7+ NEW_REALM_USER_REGISTRATION = 7REALM_REACTIVATION = 8REMOTE_SERVER_BILLING_LEGACY_LOGIN = 9REMOTE_REALM_BILLING_LEGACY_LOGIN = 10@@ -272,7 +272,7 @@ _properties = {Confirmation.MULTIUSE_INVITE: ConfirmationType("join", validity_in_days=settings.INVITATION_LINK_VALIDITY_DAYS),- Confirmation.REALM_CREATION: ConfirmationType("get_prereg_key_and_redirect"),+ Confirmation.NEW_REALM_USER_REGISTRATION: ConfirmationType("get_prereg_key_and_redirect"),Confirmation.REALM_REACTIVATION: ConfirmationType("realm_reactivation_get"),}if settings.ZILENCER_ENABLED:@@ -298,7 +298,7 @@ def one_click_unsubscribe_link(user_profile: UserProfile, email_type: str) -> st# management command.# Note that being validated here will just allow the user to access the create_realm# form, where they will enter their email and go through the regular-# Confirmation.REALM_CREATION pathway.+# Confirmation.NEW_REALM_USER_REGISTRATION pathway.# Arguably RealmCreationKey should just be another ConfirmationObjT and we should# add another Confirmation.type for this; it's this way for historical reasons.diff --git a/corporate/views/support.py b/corporate/views/support.pyindex 7bd5b2b6d3c..26936877aeb 100644--- a/corporate/views/support.py+++ b/corporate/views/support.py@@ -632,7 +632,7 @@ def support(user.id for user in PreregistrationRealm.objects.filter(email__in=key_words)]confirmations += get_confirmations(- [Confirmation.REALM_CREATION],+ [Confirmation.NEW_REALM_USER_REGISTRATION],preregistration_realm_ids,hostname=request.get_host(),)diff --git a/templates/corporate/support/support.html b/templates/corporate/support/support.htmlindex b6d25e27885..f87ea84955b 100644--- a/templates/corporate/support/support.html+++ b/templates/corporate/support/support.html@@ -76,7 +76,7 @@{% set email = object.email %}{% set realm = object.realm %}{% set show_realm_details = True %}- {% elif confirmation.type == Confirmation.REALM_CREATION %}+ {% elif confirmation.type == Confirmation.NEW_REALM_USER_REGISTRATION %}<h3>Realm creation</h3>{% set email = object.email %}{% set show_realm_details = False %}diff --git a/zerver/tests/test_slack_importer.py b/zerver/tests/test_slack_importer.pyindex 5ea5e27ac76..9e8b26d879e 100644--- a/zerver/tests/test_slack_importer.py+++ b/zerver/tests/test_slack_importer.py@@ -2273,7 +2273,9 @@ by Pieter# Confirmation key at this point is marked, used but since we# are mocking the process, we need to do it manually here.- get_object_from_key(confirmation_key, [Confirmation.REALM_CREATION], mark_object_used=True)+ get_object_from_key(+ confirmation_key, [Confirmation.NEW_REALM_USER_REGISTRATION], mark_object_used=True+ )result = self.client_get(f"/json/realm/import/status/{confirmation_key}")self.assert_in_success_response(["No users matching provided email"], result)diff --git a/zerver/views/development/registration.py b/zerver/views/development/registration.pyindex 9dad20acb2d..4ed76d44ffa 100644--- a/zerver/views/development/registration.py+++ b/zerver/views/development/registration.py@@ -71,7 +71,7 @@ def register_development_realm(request: HttpRequest) -> HttpResponse:email, realm_name, realm_subdomain, realm_type, realm_default_language)activation_url = create_confirmation_link(- prereg_realm, Confirmation.REALM_CREATION, no_associated_realm_object=True+ prereg_realm, Confirmation.NEW_REALM_USER_REGISTRATION, no_associated_realm_object=True)key = activation_url.split("/")[-1]# Need to add test data to POST request as it doesn't originally contain the required parameters@@ -106,7 +106,7 @@ def register_demo_development_realm(request: HttpRequest) -> HttpResponse:email, realm_name, realm_subdomain, realm_type, realm_default_language)activation_url = create_confirmation_link(- prereg_realm, Confirmation.REALM_CREATION, no_associated_realm_object=True+ prereg_realm, Confirmation.NEW_REALM_USER_REGISTRATION, no_associated_realm_object=True)key = activation_url.split("/")[-1]# Need to add test data to POST request as it doesn't originally contain the required parametersdiff --git a/zerver/views/registration.py b/zerver/views/registration.pyindex 28d5e782f25..73c22c932d1 100644--- a/zerver/views/registration.py+++ b/zerver/views/registration.py@@ -194,7 +194,7 @@ def check_prereg_key(confirmation_types = [Confirmation.USER_REGISTRATION,Confirmation.INVITATION,- Confirmation.REALM_CREATION,+ Confirmation.NEW_REALM_USER_REGISTRATION,]prereg_object = get_object_from_key(@@ -203,7 +203,7 @@ def check_prereg_key(assert isinstance(prereg_object, PreregistrationRealm | PreregistrationUser)confirmation_obj = prereg_object.confirmation.get()- realm_creation = confirmation_obj.type == Confirmation.REALM_CREATION+ realm_creation = confirmation_obj.type == Confirmation.NEW_REALM_USER_REGISTRATIONif realm_creation:assert isinstance(prereg_object, PreregistrationRealm)@@ -998,7 +998,7 @@ def prepare_realm_activation_url(import_form,)activation_url = create_confirmation_link(- prereg_realm, Confirmation.REALM_CREATION, no_associated_realm_object=True+ prereg_realm, Confirmation.NEW_REALM_USER_REGISTRATION, no_associated_realm_object=True)if settings.DEVELOPMENT:@@ -1052,7 +1052,7 @@ def realm_import_status(try:preregistration_realm = get_object_from_key(confirmation_key,- [Confirmation.REALM_CREATION],+ [Confirmation.NEW_REALM_USER_REGISTRATION],mark_object_used=False,allow_used=True,)@@ -1147,7 +1147,7 @@ def realm_import_post_process(try:preregistration_realm = get_object_from_key(confirmation_key,- [Confirmation.REALM_CREATION],+ [Confirmation.NEW_REALM_USER_REGISTRATION],mark_object_used=False,allow_used=True,)diff --git a/zerver/views/tusd.py b/zerver/views/tusd.pyindex 23b4db7f8ff..0e902a1cf9b 100644--- a/zerver/views/tusd.py+++ b/zerver/views/tusd.py@@ -320,7 +320,7 @@ def handle_tusd_hook(return reject_upload("Unauthenticated upload", 401)try:prereg_object = get_object_from_key(- key, [Confirmation.REALM_CREATION], mark_object_used=False+ key, [Confirmation.NEW_REALM_USER_REGISTRATION], mark_object_used=False)except ConfirmationKeyError:return reject_upload("Unauthenticated upload", 401)