Opened 4 years ago

Last modified 4 years ago

#31960 closed Uncategorized

Document that Django email validator does not enforce valid emails — at Version 1

Reported by: James Pic Owned by: nobody
Component: Uncategorized Version: 3.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by James Pic)

Currently, Django makes it seem that using an EmailField / EmailValidator will protect projects from getting invalid emails in their database, for example: emails starting with a dot like ".foo@…" will be invalid as expected.

But in reality, Django doesn't actually care : https://code.djangoproject.com/ticket/31959#ticket

This makes the following documentation statement inaccurate:

"EmailField: A CharField that checks that the value is a valid email address using EmailValidator."

Source : https://docs.djangoproject.com/en/3.1/ref/models/fields/#emailfield

It would be only fair to users to document that the EmailValidator will let invalid emails through, which will be the cause of SMTPError, and that people who don't want invalid emails in their EmailField must override and fix Django's default behaviour.

Change History (1)

comment:1 by James Pic, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top