mirror of
https://github.com/django/django.git
synced 2025-08-11 22:38:20 +00:00
[1.9.x] Fixed #26806 -- Triple quoted docstrings in docs/ref/forms/validation.txt.
Backport of 2032bcf182
from master
This commit is contained in:
parent
41ac92ef52
commit
4be49ff38a
1 changed files with 2 additions and 5 deletions
|
@ -263,19 +263,16 @@ containing comma-separated email addresses. The full class looks like this::
|
||||||
|
|
||||||
class MultiEmailField(forms.Field):
|
class MultiEmailField(forms.Field):
|
||||||
def to_python(self, value):
|
def to_python(self, value):
|
||||||
"Normalize data to a list of strings."
|
"""Normalize data to a list of strings."""
|
||||||
|
|
||||||
# Return an empty list if no input was given.
|
# Return an empty list if no input was given.
|
||||||
if not value:
|
if not value:
|
||||||
return []
|
return []
|
||||||
return value.split(',')
|
return value.split(',')
|
||||||
|
|
||||||
def validate(self, value):
|
def validate(self, value):
|
||||||
"Check if value consists only of valid emails."
|
"""Check if value consists only of valid emails."""
|
||||||
|
|
||||||
# Use the parent's handling of required fields, etc.
|
# Use the parent's handling of required fields, etc.
|
||||||
super(MultiEmailField, self).validate(value)
|
super(MultiEmailField, self).validate(value)
|
||||||
|
|
||||||
for email in value:
|
for email in value:
|
||||||
validate_email(email)
|
validate_email(email)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue