Opened 12 years ago

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

Download all attachments as: .zip

Change History (8)

comment:1 by fero, 12 years ago

Has patch: set

comment:2 by Aymeric Augustin, 12 years ago

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

by karthikabinav, 12 years ago

Attachment: patch.diff added

Replaced with the last occurence of @ symbol

comment:3 by marw85, 12 years ago

Owner: changed from nobody to marw85
Status: newassigned

by marw85, 12 years ago

Attachment: django-17504.2.diff added

comment:4 by marw85, 12 years ago

added tests, improved code style(trailing spaces)

comment:5 by Radosław Sieradzki, 12 years ago

Needs tests: unset
Triage Stage: AcceptedReady for checkin

comment:6 by Jannis Leidel, 12 years ago

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