BaseInlineFormSet does not respect commit=False in save for new objects after r10190
Reported by: |
Koen Biermans <koen.biermans@…> |
Owned by: |
jkocherhans |
Component:
|
Forms
|
Version:
|
dev
|
Severity:
|
|
Keywords:
|
formsets
|
Cc:
|
|
Triage Stage:
|
Accepted
|
Has patch:
|
yes
|
Needs documentation:
|
no
|
Needs tests:
|
no
|
Patch needs improvement:
|
no
|
Easy pickings:
|
no
|
UI/UX:
|
no
|
The save_new method on BaseInlineFormSet does not respect the commit bit passed to it (it saves the object even if commit=False). This method was added in r10190.
This means that if there are required fields that the forms on the inlineformset do not contain, you get an error, even if you use commit=False to add the required information to the new objects yourself.
Possible fix: do not do obj.save() if commit is False (line 549 in django/forms/models.py).
fix and test for baseinlineformset save not respecting commit=False