Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#12005 closed (invalid)

django.forms.fields.email_re doesn't handle single-letter subdomains

Reported by: Gumnos Owned by: djansoft
Component: Forms Version: master
Severity: Keywords: email_re subdomain speed single letter
Cc: JasonYosinski Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


When domain-validating logic was moved from validators to forms.fields.email_re single-letter sub-domains are no longer caught. There were also some speed issues when processing longer email addresses that were resolved in 1.1.1 and 1.0.4 that this patch should also address in a similar manner. There may be a similar issue with forms.fields.url_re but I didn't get a chance to hack that too.

Attachments (2)

email.patch (1.9 KB) - added by Gumnos 6 years ago.
Updated patch against trunk with test included
EmailField_single_letter_domains.diff (896 bytes) - added by djansoft 6 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 6 years ago by Gumnos

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

This may conflict with r11603 but should resolve the same email_re issue there.

comment:2 Changed 6 years ago by Gumnos

It also looks like this may be a semi-regression. Tickets #1275 and #1288 regarding the same issue are closed as fixed in r2367 but that looks like it was before some (newforms?) refactor.

Changed 6 years ago by Gumnos

Updated patch against trunk with test included

comment:3 Changed 6 years ago by russellm

  • milestone set to 1.2
  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 6 years ago by djansoft

  • Owner changed from nobody to djansoft

Changed 6 years ago by djansoft

comment:5 Changed 6 years ago by djansoft

  • Resolution set to invalid
  • Status changed from new to closed

It isn't clear if this ticket refers to 2nd level or 3rd level domains. Also, it isn't clear if with "caught" it means single-letter subdomains should be valid or rejected. In any case:

Single-letter 2nd level domains are valid:

Single-letter 3rd level domains are valid too: #1275

In both cases, Django forms is working as expected. Please see attached diff for tests.

comment:6 Changed 6 years ago by JasonYosinski

  • Cc JasonYosinski added

comment:7 Changed 4 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

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