Fix email cleaning to catch recent brokenness on the form "<bound method TempIdAuthors.email of <TempIdAuthors: XXX XXX <xxx@yyy.zzz>>>"
- Legacy-Id: 3156
This commit is contained in:
parent
7f6f9a35da
commit
fd23dc9d5d
|
@ -1,7 +1,9 @@
|
|||
from person.models import Person
|
||||
|
||||
def clean_email_address(addr):
|
||||
addr = addr.replace("<", "").replace(">", "").replace("!", "@").replace("(at)", "@").strip()
|
||||
addr = addr.replace("!", "@").replace("(at)", "@") # some obvious @ replacements
|
||||
addr = addr[addr.rfind('<') + 1:addr.find('>')] # whack surrounding <...>
|
||||
addr = addr.strip()
|
||||
if not "@" in addr:
|
||||
return ""
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue