mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #11907 -- EmailField now runs strip() on its input. This means mistakenly including leading or trailing spaces will not cause a validation error, and clean() will remove those spaces. Thanks, krisneuharth, djansoft and SmileyChris
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13997 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -448,6 +448,10 @@ class EmailField(CharField):
|
||||
}
|
||||
default_validators = [validators.validate_email]
|
||||
|
||||
def clean(self, value):
|
||||
value = self.to_python(value).strip()
|
||||
return super(EmailField, self).clean(value)
|
||||
|
||||
class FileField(Field):
|
||||
widget = ClearableFileInput
|
||||
default_error_messages = {
|
||||
|
||||
Reference in New Issue
Block a user