Opened 4 years ago

Closed 4 years ago

#17504 closed Bug (fixed)

User.objects.create_user() wrong email domain part identification

Reported by: fero Owned by: marw85
Component: contrib.auth Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

According to http://tools.ietf.org/html/rfc3696#section-3 the "@" symbol can be part of the local part of an email address, so line 129 of contrib.auth.models is bugged.

The unbelivable complex ;) patch is:

-    email_name, domain_part = email.strip().split('@', 1)
+    email_name, domain_part = email.strip().rsplit('@', 1)

Attachments (2)

patch.diff (687 bytes) - added by karthikabinav 4 years ago.
Replaced with the last occurence of @ symbol
django-17504.2.diff (4.9 KB) - added by marw85 4 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 4 years ago by fero

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 4 years ago by aaugustin

  • Easy pickings set
  • Needs tests set
  • Triage Stage changed from Unreviewed to Accepted

Changed 4 years ago by karthikabinav

Replaced with the last occurence of @ symbol

comment:3 Changed 4 years ago by marw85

  • Owner changed from nobody to marw85
  • Status changed from new to assigned

Changed 4 years ago by marw85

comment:4 Changed 4 years ago by marw85

added tests, improved code style(trailing spaces)

comment:5 Changed 4 years ago by rsiera

  • Needs tests unset
  • Triage Stage changed from Accepted to Ready for checkin

comment:6 Changed 4 years ago by jezdez

  • Resolution set to fixed
  • Status changed from assigned to closed

In [17482]:

Fixed #17504 -- Fixed normalization of email addresses that have '@' in the name when calling User.objects.create_user. Thanks, marw85.

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