summaryrefslogtreecommitdiff
path: root/django/forms/forms.py
diff options
context:
space:
mode:
authorMarc Tamlyn <marc.tamlyn@gmail.com>2013-08-08 14:05:55 +0100
committerMarc Tamlyn <marc.tamlyn@gmail.com>2013-08-08 14:05:55 +0100
commitfb1dd6b13a0e6b1ef64eac88467321d097942cd2 (patch)
tree7dfdd7b3f7a5cb2f63c5046cedfb90fa4884163c /django/forms/forms.py
parent7a2296eb5bb05a4109392f8333e934d576d79d35 (diff)
Form.clean() does not need to return cleaned_data.
If it does, that will be used as the cleaned_data. The default implementation has been changed to match this change.
Diffstat (limited to 'django/forms/forms.py')
-rw-r--r--django/forms/forms.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/django/forms/forms.py b/django/forms/forms.py
index 9905eee7c7..97ee72e98e 100644
--- a/django/forms/forms.py
+++ b/django/forms/forms.py
@@ -297,9 +297,12 @@ class BaseForm(object):
def _clean_form(self):
try:
- self.cleaned_data = self.clean()
+ cleaned_data = self.clean()
except ValidationError as e:
self._errors[NON_FIELD_ERRORS] = self.error_class(e.messages)
+ else:
+ if cleaned_data is not None:
+ self.cleaned_data = cleaned_data
def _post_clean(self):
"""
@@ -315,7 +318,7 @@ class BaseForm(object):
not be associated with a particular field; it will have a special-case
association with the field named '__all__'.
"""
- return self.cleaned_data
+ pass
def has_changed(self):
"""