Formset non_form_errors returns ErrorList() if is_valid is not called
|Reported by:||vbmendes||Owned by:||senko|
|Severity:||Normal||Keywords:||formset non_form_errors validation|
|Cc:||vbmendes@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If Formset.non_form_errors() is called before Formset.is_valid(), it will return an empty ErrorList.
Let's pretend we have two formsets in one view and we make this test: if formset1.is_valid() and formset2.is_valid(). If formset1 is not valid, formset2's is_valid() will not be called. It means that the user will have to fix all the formset1's validation erros before knowing that formset2 also has errors. It's annoying for the user.
I wrote a little patch to fix this issue. Just changing a little the Formset.non_form_errors() function.