[Django] #29605: Email Validation failed

3 views
Skip to first unread message

Django

unread,
Jul 27, 2018, 10:34:27 AM7/27/18
to django-...@googlegroups.com
#29605: Email Validation failed
------------------------------------------+------------------------
Reporter: Pavel Sirotkin | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
I have some email with from address 'Name Surname <developer-
acco...@domain.com>' which contain in EmailField() when I try save in
admin form I get exception what tell me my email not valid. This example
email stored in my DB

from django.core.validators import validate_email
validate_email('Name Surname <developer...@domain.com>')


{{{
ib/python3.5/site-packages/django/core/validators.py in __call__(self,
value)
203 if not self.user_regex.match(user_part):
204 raise ValidationError(self.message, code=self.code)
--> 205
206 if (domain_part not in self.domain_whitelist and
207 not self.validate_domain_part(domain_part)):

ValidationError: ['Enter a valid email address.']
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29605>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 27, 2018, 3:59:15 PM7/27/18
to django-...@googlegroups.com
#29605: AllowEmailValidator to accept an address with a human readable prefix
--------------------------------+--------------------------------------

Reporter: Pavel Sirotkin | Owner: nobody
Type: Bug | Status: closed
Component: Core (Other) | Version: 1.11
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by Tim Graham):

* status: new => closed
* component: Forms => Core (Other)
* resolution: => wontfix


Old description:

> I have some email with from address 'Name Surname <developer-
> acco...@domain.com>' which contain in EmailField() when I try save in
> admin form I get exception what tell me my email not valid. This example
> email stored in my DB
>
> from django.core.validators import validate_email
> validate_email('Name Surname <developer...@domain.com>')
>

> {{{
> ib/python3.5/site-packages/django/core/validators.py in __call__(self,
> value)
> 203 if not self.user_regex.match(user_part):
> 204 raise ValidationError(self.message, code=self.code)
> --> 205
> 206 if (domain_part not in self.domain_whitelist and
> 207 not self.validate_domain_part(domain_part)):
>
> ValidationError: ['Enter a valid email address.']
> }}}

New description:

I have some email with from address `'Name Surname <developer-

acco...@domain.com>'` which contain in `EmailField` when I try save in


admin form I get exception what tell me my email not valid. This example
email stored in my DB
{{{
from django.core.validators import validate_email
validate_email('Name Surname <developer...@domain.com>')
}}}

{{{
ib/python3.5/site-packages/django/core/validators.py in __call__(self,
value)
203 if not self.user_regex.match(user_part):
204 raise ValidationError(self.message, code=self.code)
--> 205
206 if (domain_part not in self.domain_whitelist and
207 not self.validate_domain_part(domain_part)):

ValidationError: ['Enter a valid email address.']
}}}

--

Comment:

I think this is by design and I don't see it changing. In fact ,there's
another ticket to relax the validation to use HTML5 validation (#26423).
You should use a custom field and validator for your use case.

--
Ticket URL: <https://code.djangoproject.com/ticket/29605#comment:1>

Django

unread,
Jul 27, 2018, 4:08:27 PM7/27/18
to django-...@googlegroups.com
#29605: Allow EmailValidator to accept an address with a human readable prefix
--------------------------------+--------------------------------------

Reporter: Pavel Sirotkin | Owner: nobody
Type: Bug | Status: closed
Component: Core (Other) | Version: 1.11
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/29605#comment:2>

Django

unread,
Jul 29, 2018, 1:32:57 AM7/29/18
to django-...@googlegroups.com
#29605: Allow EmailValidator to accept an address with a human readable prefix
--------------------------------+--------------------------------------
Reporter: Pavel Sirotkin | Owner: nobody
Type: Bug | Status: closed
Component: Core (Other) | Version: 1.11
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by Zach Borboa):

Per rfc5322, the field is called `display-name`.

--
Ticket URL: <https://code.djangoproject.com/ticket/29605#comment:3>

Reply all
Reply to author
Forward
0 new messages