Code

Ticket #11907: 11907.diff

File 11907.diff, 535 bytes (added by krisneuharth, 4 years ago)

Patch for #11907

Line 
1Index: django/forms/fields.py
2===================================================================
3--- django/forms/fields.py      (revision 12394)
4+++ django/forms/fields.py      (working copy)
5@@ -414,6 +414,11 @@
6         'invalid': _(u'Enter a valid e-mail address.'),
7     }
8     default_validators = [validators.validate_email]
9+
10+    def clean(self, value):
11+        value = value.strip()
12+        value = super(EmailField, self).clean(value)
13+        return value
14
15 class FileField(Field):
16     widget = FileInput