mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
This commit is contained in:
@@ -25,8 +25,6 @@ exception or returns the clean value::
|
||||
>>> f = forms.EmailField()
|
||||
>>> f.clean('foo@example.com')
|
||||
u'foo@example.com'
|
||||
>>> f.clean(u'foo@example.com')
|
||||
u'foo@example.com'
|
||||
>>> f.clean('invalid email address')
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
|
||||
@@ -184,7 +184,7 @@ a look at Django's ``EmailField``::
|
||||
|
||||
class EmailField(CharField):
|
||||
default_error_messages = {
|
||||
'invalid': _(u'Enter a valid e-mail address.'),
|
||||
'invalid': _('Enter a valid e-mail address.'),
|
||||
}
|
||||
default_validators = [validators.validate_email]
|
||||
|
||||
@@ -197,7 +197,7 @@ on field definition so::
|
||||
is equivalent to::
|
||||
|
||||
email = forms.CharField(validators=[validators.validate_email],
|
||||
error_messages={'invalid': _(u'Enter a valid e-mail address.')})
|
||||
error_messages={'invalid': _('Enter a valid e-mail address.')})
|
||||
|
||||
|
||||
Form field default cleaning
|
||||
|
||||
Reference in New Issue
Block a user