diff --git a/django/contrib/contenttypes/generic.py b/django/contrib/contenttypes/generic.py
a
|
b
|
|
342 | 342 | setattr(form.instance, self.ct_field.attname, ContentType.objects.get_for_model(self.instance).pk) |
343 | 343 | return form |
344 | 344 | |
| 345 | def save_new(self, form, commit=True): |
| 346 | # Avoid a circular import. |
| 347 | from django.contrib.contenttypes.models import ContentType |
| 348 | kwargs = { |
| 349 | self.ct_field.get_attname(): ContentType.objects.get_for_model(self.instance).pk, |
| 350 | self.ct_fk_field.get_attname(): self.instance.pk, |
| 351 | } |
| 352 | new_obj = self.model(**kwargs) |
| 353 | return save_instance(form, new_obj, commit=commit) |
| 354 | |
345 | 355 | def generic_inlineformset_factory(model, form=ModelForm, |
346 | 356 | formset=BaseGenericInlineFormSet, |
347 | 357 | ct_field="content_type", fk_field="object_id", |