From 494797ea0a57e1cf487d549d73826a221101568a Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sat, 17 Oct 2015 12:41:06 -0400 Subject: [PATCH] Fix has_valid_realm logic following get_realm refactor. --- zerver/forms.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/zerver/forms.py b/zerver/forms.py index 3835279395..fc75c3e10b 100644 --- a/zerver/forms.py +++ b/zerver/forms.py @@ -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