Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#29605 closed Bug (wontfix)

Allow EmailValidator to accept an address with a human readable prefix

Reported by: Pavel Sirotkin Owned by: nobody
Component: Core (Other) Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

I have some email with from address 'Name Surname <developer-accounts@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-accounts@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.']

Change History (3)

comment:1 by Tim Graham, 6 years ago

Component: FormsCore (Other)
Description: modified (diff)
Resolution: wontfix
Status: newclosed
Summary: Email Validation failedAllowEmailValidator to accept an address with a human readable prefix

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.

comment:2 by Tim Graham, 6 years ago

Summary: AllowEmailValidator to accept an address with a human readable prefixAllow EmailValidator to accept an address with a human readable prefix

comment:3 by Zach Borboa, 6 years ago

Per rfc5322, the field is called display-name.

Note: See TracTickets for help on using tickets.
Back to Top