mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
[1.5.x] Fixed #18574 -- Make BaseFormSet.is_valid call its underlying forms' is_valid
Thanks Simon Charette for the report and the initial patch.
Backport of 66dfcc10b from master.
This commit is contained in:
committed by
Claude Paroz
parent
e9301ae451
commit
67bddc0b7b
@@ -267,7 +267,7 @@ class BaseFormSet(object):
|
||||
|
||||
def is_valid(self):
|
||||
"""
|
||||
Returns True if form.errors is empty for every form in self.forms.
|
||||
Returns True if every form in self.forms is valid.
|
||||
"""
|
||||
if not self.is_bound:
|
||||
return False
|
||||
@@ -282,8 +282,7 @@ class BaseFormSet(object):
|
||||
# This form is going to be deleted so any of its errors
|
||||
# should not cause the entire formset to be invalid.
|
||||
continue
|
||||
if bool(self.errors[i]):
|
||||
forms_valid = False
|
||||
forms_valid &= form.is_valid()
|
||||
return forms_valid and not bool(self.non_form_errors())
|
||||
|
||||
def full_clean(self):
|
||||
|
||||
Reference in New Issue
Block a user