Re:The Correct Way to Validate Email Addresses
by honkhonkpants on Wednesday September 07, 2016 @08:48PM
(#12449341)
Regarding that testdata, what is the reason for rejecting bare IP literals on the right hand side? It seems pedantic to require the square braces.
[ Parent
| on HN ]
Re:The Correct Way to Validate Email Addresses
by tedmiston on Thursday September 08, 2016 @02:36PM
(#12455864)
That part is confusing to me.
I ran a fresh install of Django to confirm and it behaves as you suggest.
Edit: Perhaps only for low digits. Hmm.
>>> from django.core.validators import EmailValidator
>>> e = EmailValidator()
>>> e.__call__('foo@[1.2.3.4]')
>>> e.__call__('[email protected]')
ValidationError: [u'Enter a valid email address.']
>>> e.__call__('[email protected]')
ValidationError: [u'Enter a valid email address.']
>>> e.__call__('foo@[0.0.0.0]')
>>> e.__call__('[email protected]')
>>> e.__call__('foo@[10.10.10.10]')
>>> e.__call__('[email protected]')
>>> e.__call__('foo@[255.255.255.255]')
Re:The Correct Way to Validate Email Addresses
by honkhonkpants on Thursday September 08, 2016 @03:30PM
(#12456459)
Huh. "Well tested" indeed.