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: Provide a better exception message.

Alex Vandiverdb38d43473ec
diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py
index 115b6e57666..529e51af651 100644
--- a/zerver/tests/test_signup.py
+++ b/zerver/tests/test_signup.py
@@ -2086,7 +2086,9 @@ class UserSignUpTest(ZulipTestCase):
self.assert_in_response(
"https://zulip.readthedocs.io/en/latest/subsystems/email.html", result
)
- self.assertTrue("ERROR:root:Error in accounts_home" in m.output[0])
+ self.assertTrue(
+ "ERROR:root:Failed to deliver email during user registration" in m.output[0]
+ )
def test_bad_email_configuration_for_create_realm(self) -> None:
"""
@@ -2108,7 +2110,7 @@ class UserSignUpTest(ZulipTestCase):
self.assert_in_response(
"https://zulip.readthedocs.io/en/latest/subsystems/email.html", result
)
- self.assertTrue("ERROR:root:Error in create_realm" in m.output[0])
+ self.assertTrue("ERROR:root:Failed to deliver email during realm creation" in m.output[0])
def test_user_default_language_and_timezone(self) -> None:
"""
diff --git a/zerver/views/registration.py b/zerver/views/registration.py
index 2e00304ec1d..bc792fd6d7a 100644
--- a/zerver/views/registration.py
+++ b/zerver/views/registration.py
@@ -816,7 +816,7 @@ def create_realm(request: HttpRequest, creation_key: Optional[str] = None) -> Ht
try:
send_confirm_registration_email(email, activation_url, request=request)
except EmailNotDeliveredError:
- logging.error("Error in create_realm")
+ logging.exception("Failed to deliver email during realm creation")
return config_error(request, "smtp")
if key_record is not None:
@@ -946,7 +946,7 @@ def accounts_home(
try:
send_confirm_registration_email(email, activation_url, request=request, realm=realm)
except EmailNotDeliveredError:
- logging.error("Error in accounts_home")
+ logging.exception("Failed to deliver email during user registration")
return config_error(request, "smtp")
signup_send_confirm_url = reverse("signup_send_confirm")
query = urlencode({"email": email})