summaryrefslogtreecommitdiff
path: root/django/forms/formsets.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2018-02-05 10:29:38 -0500
committerGitHub <noreply@github.com>2018-02-05 10:29:38 -0500
commit16ee53d7bb01819859c78a88e3fc93eda985f71a (patch)
tree8daac119284ce8b92a0daa3d163c97bd630ec66b /django/forms/formsets.py
parent7515e1f3fc710001734ff664efd87366d7973c63 (diff)
Fixed #29113 -- Simplified django.forms.formsets.all_valid() and clarified docstring.
Diffstat (limited to 'django/forms/formsets.py')
-rw-r--r--django/forms/formsets.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/forms/formsets.py b/django/forms/formsets.py
index 5133164f7a..1b95bfa4c5 100644
--- a/django/forms/formsets.py
+++ b/django/forms/formsets.py
@@ -436,9 +436,8 @@ def formset_factory(form, formset=BaseFormSet, extra=1, can_order=False,
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
for formset in formsets:
- if not formset.is_valid():
- valid = False
+ valid &= formset.is_valid()
return valid