Skip to content

Commit

Permalink
Merge pull request #39 from golnazads/master
Browse files Browse the repository at this point in the history
use match instead of findall to compare aff with aff_canonical
  • Loading branch information
golnazads authored Mar 22, 2022
2 parents 488d5fc + 69a4f2e commit d6e85b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion authoraffsrv/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d6e85b5

Please sign in to comment.