Opened 8 years ago

Closed 8 years ago

#14583 closed (duplicate)

EmailField rejects valid emails if followed by trailing whitespace

Reported by: Eloff Owned by: nobody
Component: Forms Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I just had this issue on a production django site, reported by a customer. The form was rejecting his email address and he did not know why. I confirmed that the email address passes validation just fine, but that he was consistently entering trailing whitespace in the form field that caused it and others to fail validation.

I think the logical thing to do here, since leading and trailing whitespace cannot be significant to an email, and may also cause issues when using the cleaned value, is to override to_python on EmailField to strip() the value. I have hot-patched django in my website to do this, and it has resolved the issue for me.

Change History (1)

comment:1 Changed 8 years ago by Russell Keith-Magee

Resolution: duplicate
Status: newclosed

Duplicate of #11907, fixed in [13997] (which will be part of 1.2.3 when it is released)

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