Wizard sets queryset instead of instance on InlineFormset
|Reported by:||banderkat@…||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Because InlineFormSet subclasses BaseModelFormSet, the wizard thinks it's like any BaseModelFormSet and incorrectly initializes the form by setting the form's queryset instead of the form's instance. An InlineFormSet needs to have its instance set to the parent model object instead.
Currently, attempting to set self.instance for the InlineFormSet in the wizard's get_form_instance results in an AttributeError saying "object has no attribute 'none'" as the wizard attempts to set the form's queryset (instead of instance) with it's self.instance.
I have a fix to propose here:
Change History (7)
comment:1 Changed 20 months ago by timo
- Needs documentation unset
- Needs tests set
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted