1
0
mirror of https://github.com/django/django.git synced 2025-10-30 17:16:10 +00:00

Fixed 10075: Allowed saving of inline-edited models that use multi-table inheritance.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Karen Tracey
2009-02-03 14:02:09 +00:00
parent ecadf67569
commit 81ae2afdec
2 changed files with 34 additions and 1 deletions

View File

@@ -493,7 +493,7 @@ class BaseInlineFormSet(BaseModelFormSet):
fk_attname = self.fk.get_attname()
kwargs = {fk_attname: self.instance.pk}
new_obj = self.model(**kwargs)
if fk_attname == self._pk_field.attname:
if fk_attname == self._pk_field.attname or self._pk_field.auto_created:
exclude = [self._pk_field.name]
else:
exclude = []