From 69a4f2e2ea481d7a26bac1c37d880ef691be8c72 Mon Sep 17 00:00:00 2001 From: golnazads <28757512+golnazads@users.noreply.github.com> Date: Tue, 22 Mar 2022 09:20:25 -0400 Subject: [PATCH] use match instead of findall to compare aff with aff_canonical --- authoraffsrv/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authoraffsrv/utils.py b/authoraffsrv/utils.py index 2124d07..44a773d 100644 --- a/authoraffsrv/utils.py +++ b/authoraffsrv/utils.py @@ -50,7 +50,7 @@ def get_solr_data(bibcodes, cutoff_year, start=0, sort='date desc'): # if canonical affiliation is a valid affiliation, isn't just dashes use that, otherwise use aff aff_canonical = doc.pop('aff_canonical', None) if aff_canonical: - aff = [canonical if len(re_valid_affiliation.findall(canonical)) > 0 else regular for regular, canonical in zip(doc.get('aff'), aff_canonical)] + aff = [canonical if re_valid_affiliation.findall(canonical) else regular for regular, canonical in zip(doc.get('aff'), aff_canonical)] doc.update({u'aff': aff}) return from_solr else: