Fixed #9362 -- Prevented inline forms from overwriting the content_type_id attribute on objets being inlined. Thanks to carljm for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10667 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2009-05-03 13:38:36 +00:00
parent 2c24bba934
commit 80a54dd23b
5 changed files with 54 additions and 3 deletions

View file

@ -137,7 +137,7 @@ class InlineAdminForm(AdminForm):
self.formset = formset
self.original = original
if original is not None:
self.original.content_type_id = ContentType.objects.get_for_model(original).pk
self.original_content_type_id = ContentType.objects.get_for_model(original).pk
self.show_url = original and hasattr(original, 'get_absolute_url')
super(InlineAdminForm, self).__init__(form, fieldsets, prepopulated_fields)