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.
Change History (12)
Changed 6 years ago by vbmendes
comment:1 Changed 6 years ago by anonymous
- Cc vbmendes@… added
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:6 Changed 2 years ago by senko
- Owner changed from nobody to senko
- Status changed from new to assigned
comment:10 Changed 2 years ago by Senko Rasic <senko.rasic@…>
- Resolution set to fixed
- Status changed from assigned to closed