Skip to content

Commit

Permalink
[1.9.x] Fixed #26806 -- Triple quoted docstrings in docs/ref/forms/va…
Browse files Browse the repository at this point in the history
…lidation.txt.

Backport of 2032bcf from master
  • Loading branch information
andersonresende authored and timgraham committed Jun 27, 2016
1 parent 41ac92e commit 4be49ff
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions docs/ref/forms/validation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 4be49ff

Please sign in to comment.