Fixed #32905 -- Added CSS class for non-form errors of formsets.

This commit is contained in:
Ties Jan Hefting 2021-07-07 22:50:30 +02:00 committed by Mariusz Felisiak
parent 7f33c1e22d
commit 84400d2e9d
6 changed files with 42 additions and 3 deletions

View file

@ -365,6 +365,20 @@ The formset ``clean`` method is called after all the ``Form.clean`` methods
have been called. The errors will be found using the ``non_form_errors()``
method on the formset.
Non-form errors will be rendered with an additional class of ``nonform`` to
help distinguish them from form-specific errors. For example,
``{{ formset.non_form_errors }}`` would look like:
.. code-block:: html+django
<ul class="errorlist nonform">
<li>Articles in a set must have distinct titles.</li>
</ul>
.. versionchanged:: 4.0
The additional ``nonform`` class was added.
Validating the number of forms in a formset
===========================================