`BaseFormSet.is_valid` should call it's underlying forms' `is_valid`
|Reported by:||charettes||Owned by:||nobody|
|Severity:||Normal||Keywords:||form formset is_valid|
|Cc:||foonicorn||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The actual implementation of BaseFormSet.is_valid checks if any of it's underlying forms have errors which short circuits any extra check-ups that could be defined in the form is_valid method.
class MyForm(Form): def is_valid(self): is_valid = super(MyForm, self).is_valid() print 'I was called' return is_valid and self.other_non_field_related_validation() MyFormSet = formset_factory(MyForm) # In this case calling MyFormSet(data).is_valid() will never print 'I was called'.
I'm submitting this as a bug since I don't think that's the expected behaviour.
Change History (9)
comment:1 Changed 3 years ago by charettes
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:3 Changed 3 years ago by claudep
- Needs tests set
- Triage Stage changed from Unreviewed to Accepted
Changed 3 years ago by foonicorn
comment:7 Changed 3 years ago by Claude Paroz <claude@…>
- Resolution set to fixed
- Status changed from new to closed