mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
Fixed #20464 -- Added a total_error_count method on formsets.
Thanks to frog32 for the report and to Tim Graham for the review.
This commit is contained in:
committed by
Tim Graham
parent
aa22cbd51a
commit
1b7634a0d0
@@ -263,6 +263,13 @@ class BaseFormSet(object):
|
||||
self.full_clean()
|
||||
return self._errors
|
||||
|
||||
def total_error_count(self):
|
||||
"""
|
||||
Returns the number of errors across all forms in the formset.
|
||||
"""
|
||||
return len(self.non_form_errors()) +\
|
||||
sum(len(form_errors) for form_errors in self.errors)
|
||||
|
||||
def _should_delete_form(self, form):
|
||||
"""
|
||||
Returns whether or not the form was marked for deletion.
|
||||
|
||||
Reference in New Issue
Block a user