diff options
| author | Senko Rasic <senko.rasic@dobarkod.hr> | 2013-05-18 13:44:27 +0200 |
|---|---|---|
| committer | Senko Rasic <senko.rasic@dobarkod.hr> | 2013-05-18 13:44:27 +0200 |
| commit | 493aca453aa94f160764d9a89c8043f7c9a67a78 (patch) | |
| tree | f5793baf8c86fc4ebbc5c28df58f344acf60bb45 /django/forms/formsets.py | |
| parent | 566e284c565a9ea95d81756c6b1f94dfa63fc61b (diff) | |
Fixed #11160 - Ensure full_clean is called from non_form_errors
Updated FormSet.non_form_errors() to ensure full_clean() has
been called before returning the errors.
Diffstat (limited to 'django/forms/formsets.py')
| -rw-r--r-- | django/forms/formsets.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/django/forms/formsets.py b/django/forms/formsets.py index d421770093..3ec94d20ec 100644 --- a/django/forms/formsets.py +++ b/django/forms/formsets.py @@ -250,9 +250,9 @@ class BaseFormSet(object): form -- i.e., from formset.clean(). Returns an empty ErrorList if there are none. """ - if self._non_form_errors is not None: - return self._non_form_errors - return self.error_class() + if self._non_form_errors is None: + self.full_clean() + return self._non_form_errors @property def errors(self): @@ -291,9 +291,12 @@ class BaseFormSet(object): def full_clean(self): """ - Cleans all of self.data and populates self._errors. + Cleans all of self.data and populates self._errors and + self._non_form_errors. """ self._errors = [] + self._non_form_errors = self.error_class() + if not self.is_bound: # Stop further processing. return for i in range(0, self.total_form_count()): |
