#17561: EmailField does not automatically lower the case in email addresses
-------------------------------------+-------------------------------------
Reporter: zechs.marquie@… | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 1.3
(models, ORM) | Resolution: invalid
Severity: Normal | Triage Stage:
Keywords: EmailField, | Unreviewed
duplicates | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Comment (by anonymous):
Interesting, my company ran into this problem as well. We ended up having
to run a South schema migration on 2 million users, after making the
following modification:
{{{
def email_prep(self, value):
"""
Lower-cases the value returned by super, while still allowing nullable
email fields.
"""
prep_value = super(EmailField, self).get_prep_value()
if prep_value is not None:
return prep_value.lower()
return prep_value
EmailField.get_prep_value = email_prep
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/17561#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.