Fixed #29113 -- Simplified django.forms.formsets.all_valid() and clarified docstring.

This commit is contained in:
Tim Graham 2018-02-05 10:29:38 -05:00 committed by GitHub
parent 7515e1f3fc
commit 16ee53d7bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -436,9 +436,8 @@ def formset_factory(form, formset=BaseFormSet, extra=1, can_order=False,
def all_valid(formsets): def all_valid(formsets):
"""Return True if every formset in formsets is valid.""" """Validate every formset and return True if all are valid."""
valid = True valid = True
for formset in formsets: for formset in formsets:
if not formset.is_valid(): valid &= formset.is_valid()
valid = False
return valid return valid