With an author header like this: Author: foobar@gmail.com <foobar@gmail.com@a9fa2536-c6e1-c3a1-1ef2-e4143cdeeb22>
you get this error:
File "/var/local/allura/Allura/allura/model/repository.py", line 943, in authored_user return User.by_email_address(self.authored.email) File "/var/local/allura/Allura/allura/model/auth.py", line 647, in by_email_address addrs = EmailAddress.find(dict(email=addr, confirmed=True)) File "/var/local/allura/Allura/allura/model/auth.py", line 144, in find email = cls.canonical(q['email']) File "/var/local/allura/Allura/allura/model/auth.py", line 172, in canonical user, domain = addr.split('@') ValueError: too many values to unpack
This can cause a repo import to fail. We should handle it better.
Simple fix could be for
canonical
to return the provided email address if it isn't an expected format (too many@
s)Closed #753.
ib/7856
So as it is now:
The test on line
104
asserts the input email'I Am Nobody <nobody@example.com>'
outputs to'nobody@example.com'
.So shouldn't the test at
108
also return only the address? i.e.'I Am@Nobody <nobody@example.com>
output tonobody@example.com
Hm.. probably you're right. Seems like regexp does not catch this, but I don't see why immediately. I'll investigate more.
Closed #757. Force-pushed
ib/7856
(rebase)Email regex didn't expect whitespace symbols in the end of the string. Fixed and expanded test.
Last edit: Igor Bondarenko 2015-04-21
Looks good, thanks Igor.