mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #11872 -- Instantiate the correct model in BaseInlineFormSet.__init__ when instance is None. Thanks tobias.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11688 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -705,7 +705,7 @@ class BaseInlineFormSet(BaseModelFormSet):
|
||||
save_as_new=False, prefix=None):
|
||||
from django.db.models.fields.related import RelatedObject
|
||||
if instance is None:
|
||||
self.instance = self.model()
|
||||
self.instance = self.fk.rel.to()
|
||||
else:
|
||||
self.instance = instance
|
||||
self.save_as_new = save_as_new
|
||||
|
||||
Reference in New Issue
Block a user