Created
April 23, 2014 13:46
-
-
Save gregmuellegger/11215761 to your computer and use it in GitHub Desktop.
A django.db.models.fields.EmailField that forces lower case letters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Taken from: https://code.djangoproject.com/ticket/17561#comment:7 | |
''' | |
from django.db import models | |
class EmailField(models.EmailField): | |
def get_prep_value(self, value): | |
value = super(EmailField, self).get_prep_value(value) | |
if value is not None: | |
value = value.lower() | |
return value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment