Kaydet (Commit) 2032bcf1 authored tarafından Anderson Resende's avatar Anderson Resende Kaydeden (comit) Tim Graham

Fixed #26806 -- Triple quoted docstrings in docs/ref/forms/validation.txt.

üst 9588718c
......@@ -263,19 +263,16 @@ containing comma-separated email addresses. The full class looks like this::
class MultiEmailField(forms.Field):
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.
if not value:
return []
return value.split(',')
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.
super(MultiEmailField, self).validate(value)
for email in value:
validate_email(email)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment