refactor: Rename validate_email_for_realm.

Now called:

    validate_email_not_already_in_realm

We have a separate validation function that
makes sure that the email fits into a realm's
domain scheme, and we want to avoid naming
confusion here.
This commit is contained in:
Steve Howell
2020-03-02 12:24:50 +00:00
committed by Tim Abbott
parent c43a29ff54
commit 57f1aa722c
4 changed files with 10 additions and 10 deletions

View File

@@ -5035,7 +5035,7 @@ def email_not_system_bot(email: str) -> None:
params=dict(deactivated=False),
)
def validate_email_for_realm(target_realm: Realm, email: str) -> None:
def validate_email_not_already_in_realm(target_realm: Realm, email: str) -> None:
email_not_system_bot(email)
try:
@@ -5070,7 +5070,7 @@ def validate_email(user_profile: UserProfile, email: str) -> Tuple[Optional[str]
return _("Email addresses containing + are not allowed."), None, False
try:
validate_email_for_realm(user_profile.realm, email)
validate_email_not_already_in_realm(user_profile.realm, email)
except ValidationError as error:
return None, (error.code), (error.params['deactivated'])