subject_links: Remove useless RealmFilter.DoesNotExist case.

This commit is contained in:
Tim Abbott 2016-05-31 19:46:42 -07:00
parent 68fba3579d
commit e89730dc8f
1 changed files with 6 additions and 9 deletions

View File

@ -1025,16 +1025,13 @@ def subject_links(domain, subject):
from zerver.models import get_realm, RealmFilter, realm_filters_for_domain from zerver.models import get_realm, RealmFilter, realm_filters_for_domain
matches = [] # type: List[text_type] matches = [] # type: List[text_type]
try: realm_filters = realm_filters_for_domain(domain)
realm_filters = realm_filters_for_domain(domain)
for realm_filter in realm_filters: for realm_filter in realm_filters:
pattern = prepare_realm_pattern(realm_filter[0]) pattern = prepare_realm_pattern(realm_filter[0])
for m in re.finditer(pattern, subject): for m in re.finditer(pattern, subject):
matches += [realm_filter[1] % m.groupdict()] matches += [realm_filter[1] % m.groupdict()]
return matches return matches
except RealmFilter.DoesNotExist:
return matches
def make_realm_filters(domain, filters): def make_realm_filters(domain, filters):
global md_engines, realm_filter_data global md_engines, realm_filter_data