Code

Opened 4 years ago

Closed 4 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:

Description

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.

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.