1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #10750: respect comment=False in inline formsets. Thanks, Koen Biermans.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10706 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss
2009-05-08 09:59:46 +00:00
parent eaf8ec54d2
commit 614d881450
2 changed files with 28 additions and 2 deletions

View File

@@ -734,7 +734,8 @@ class BaseInlineFormSet(BaseModelFormSet):
# save the object.
obj = form.save(commit=False)
setattr(obj, self.fk.get_attname(), self.instance.pk)
obj.save()
if commit:
obj.save()
# form.save_m2m() can be called via the formset later on if commit=False
if commit and hasattr(form, 'save_m2m'):
form.save_m2m()