Fix has_valid_realm logic following get_realm refactor.

This commit is contained in:
Tim Abbott 2015-10-17 12:41:06 -04:00
parent 3e1f4e611c
commit 494797ea0a
1 changed files with 2 additions and 5 deletions

View File

@ -23,11 +23,8 @@ if settings.ZULIP_COM:
def has_valid_realm(value):
# Checks if there is a realm without invite_required
# matching the domain of the input e-mail.
try:
realm = get_realm(resolve_email_to_domain(value))
except Realm.DoesNotExist:
return False
return not realm.invite_required
realm = get_realm(resolve_email_to_domain(value))
return realm is not None and not realm.invite_required
def not_mit_mailing_list(value):
# I don't want ec-discuss signed up for Zulip