mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
zilencer: Give a better error message for foo@example.com emails.
This commit is contained in:
committed by
Tim Abbott
parent
a1895683b2
commit
9d66a8eb73
@@ -5239,7 +5239,7 @@ class PushBouncerSignupTest(ZulipTestCase):
|
|||||||
|
|
||||||
request["contact_email"] = "admin@example.com"
|
request["contact_email"] = "admin@example.com"
|
||||||
result = self.client_post("/api/v1/remotes/server/register", request)
|
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.
|
# An example disposable domain.
|
||||||
request["contact_email"] = "admin@mailnator.com"
|
request["contact_email"] = "admin@mailnator.com"
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ def register_remote_server(
|
|||||||
|
|
||||||
contact_email_domain = Address(addr_spec=contact_email).domain.lower()
|
contact_email_domain = Address(addr_spec=contact_email).domain.lower()
|
||||||
if contact_email_domain == "example.com":
|
if contact_email_domain == "example.com":
|
||||||
raise JsonableError(_("Invalid address."))
|
raise JsonableError(_("Invalid email address."))
|
||||||
|
|
||||||
# Check if the domain has an MX record
|
# Check if the domain has an MX record
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user