mirror of
https://github.com/zulip/zulip.git
synced 2025-10-30 03:23:50 +00:00
email_validation: Rename to validate_is_not_disposable.
This clarifies what we are asserting -- namely, that the email is _not_ disposable.
This commit is contained in:
committed by
Tim Abbott
parent
c1aadbe52e
commit
4b512b3409
@@ -17,7 +17,7 @@ from zerver.models.realms import (
|
||||
from zerver.models.users import get_users_by_delivery_email, is_cross_realm_bot_email
|
||||
|
||||
|
||||
def validate_disposable(email: str) -> None:
|
||||
def validate_is_not_disposable(email: str) -> None:
|
||||
if is_disposable_domain(Address(addr_spec=email).domain):
|
||||
raise DisposableEmailError
|
||||
|
||||
@@ -26,7 +26,7 @@ def get_realm_email_validator(realm: Realm) -> Callable[[str], None]:
|
||||
if not realm.emails_restricted_to_domains:
|
||||
# Should we also do '+' check for non-restricted realms?
|
||||
if realm.disallow_disposable_email_addresses:
|
||||
return validate_disposable
|
||||
return validate_is_not_disposable
|
||||
|
||||
# allow any email through
|
||||
return lambda email: None
|
||||
|
||||
Reference in New Issue
Block a user