Opened 5 years ago

Closed 5 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 5 years ago.
Replaced with the last occurence of @ symbol
django-17504.2.diff (4.9 KB) - added by marw85 5 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 5 years ago by fero

Has patch: set

comment:2 Changed 5 years ago by Aymeric Augustin

Easy pickings: set
Needs tests: set
Triage Stage: UnreviewedAccepted

Changed 5 years ago by karthikabinav

Attachment: patch.diff added

Replaced with the last occurence of @ symbol

comment:3 Changed 5 years ago by marw85

Owner: changed from nobody to marw85
Status: newassigned

Changed 5 years ago by marw85

Attachment: django-17504.2.diff added

comment:4 Changed 5 years ago by marw85

added tests, improved code style(trailing spaces)

comment:5 Changed 5 years ago by Radosław Sieradzki

Needs tests: unset
Triage Stage: AcceptedReady for checkin

comment:6 Changed 5 years ago by Jannis Leidel

Resolution: fixed
Status: assignedclosed

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