Opened 10 years ago
Closed 10 years ago
#25065 closed Uncategorized (invalid)
Should EmailField empty_strings_allowed be False
| Reported by: | Alex Orange | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 1.8 |
| 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
Sorry for stating this as a question, I'm a little new to django internals. Someone should check that I understand the usage of empty_strings_allowed properly. It seems that perhaps EmailField should have empty_strings_allowed set to False since empty strings don't validate.
Note:
See TracTickets
for help on using tickets.
empty_strings_allowedcontrols whether empty values may be stored as an empty string or if they must be stored as null. In the case ofEmailField, empty strings are fine. See also the second paragraph in the Field.null docs.