From 9d66a8eb73d17480945ed3955ffc4e206f0947e4 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Thu, 23 May 2024 18:27:33 +0000 Subject: [PATCH] zilencer: Give a better error message for foo@example.com emails. --- zerver/tests/test_push_notifications.py | 2 +- zilencer/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zerver/tests/test_push_notifications.py b/zerver/tests/test_push_notifications.py index 4091d51060..49d85436ba 100644 --- a/zerver/tests/test_push_notifications.py +++ b/zerver/tests/test_push_notifications.py @@ -5239,7 +5239,7 @@ class PushBouncerSignupTest(ZulipTestCase): request["contact_email"] = "admin@example.com" result = self.client_post("/api/v1/remotes/server/register", request) - self.assert_json_error(result, "Invalid address.") + self.assert_json_error(result, "Invalid email address.") # An example disposable domain. request["contact_email"] = "admin@mailnator.com" diff --git a/zilencer/views.py b/zilencer/views.py index d2789ef59f..def17306c1 100644 --- a/zilencer/views.py +++ b/zilencer/views.py @@ -167,7 +167,7 @@ def register_remote_server( contact_email_domain = Address(addr_spec=contact_email).domain.lower() if contact_email_domain == "example.com": - raise JsonableError(_("Invalid address.")) + raise JsonableError(_("Invalid email address.")) # Check if the domain has an MX record try: