Skip to content

Commit fd23dc9

Browse files
committed
Fix email cleaning to catch recent brokenness on the form "<bound method TempIdAuthors.email of <TempIdAuthors: XXX XXX <xxx@yyy.zzz>>>"
- Legacy-Id: 3156
1 parent 7f6f9a3 commit fd23dc9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

redesign/importing/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from person.models import Person
22

33
def clean_email_address(addr):
4-
addr = addr.replace("<", "").replace(">", "").replace("!", "@").replace("(at)", "@").strip()
4+
addr = addr.replace("!", "@").replace("(at)", "@") # some obvious @ replacements
5+
addr = addr[addr.rfind('<') + 1:addr.find('>')] # whack surrounding <...>
6+
addr = addr.strip()
57
if not "@" in addr:
68
return ""
79
else:

0 commit comments

Comments
 (0)