From 84400d2e9db7c51fee4e9bb04c028f665b8e7624 Mon Sep 17 00:00:00 2001 From: Ties Jan Hefting Date: Wed, 7 Jul 2021 22:50:30 +0200 Subject: Fixed #32905 -- Added CSS class for non-form errors of formsets. --- django/forms/formsets.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'django/forms') diff --git a/django/forms/formsets.py b/django/forms/formsets.py index a89c35599f..b8e0d62fd9 100644 --- a/django/forms/formsets.py +++ b/django/forms/formsets.py @@ -333,7 +333,7 @@ class BaseFormSet: self._non_form_errors. """ self._errors = [] - self._non_form_errors = self.error_class() + self._non_form_errors = self.error_class(error_class='nonform') empty_forms_count = 0 if not self.is_bound: # Stop further processing. @@ -380,7 +380,10 @@ class BaseFormSet: # Give self.clean() a chance to do cross-form validation. self.clean() except ValidationError as e: - self._non_form_errors = self.error_class(e.error_list) + self._non_form_errors = self.error_class( + e.error_list, + error_class='nonform' + ) def clean(self): """ -- cgit v1.3