Add an explicit exclude for polymorphic_ctype in the PolymorphicInlineModelAdmin

fix_request_path_info
Diederik van der Boor 2017-04-06 12:47:28 +02:00
parent c2aff50ecc
commit cd38e785b2
1 changed files with 1 additions and 0 deletions

View File

@ -223,6 +223,7 @@ class PolymorphicInlineModelAdmin(InlineModelAdmin):
exclude = list(self.exclude) exclude = list(self.exclude)
exclude.extend(self.get_readonly_fields(request, obj)) exclude.extend(self.get_readonly_fields(request, obj))
exclude.append('polymorphic_ctype') # Django 1.10 blocks it, as it's a readonly field.
if self.exclude is None and hasattr(self.form, '_meta') and self.form._meta.exclude: if self.exclude is None and hasattr(self.form, '_meta') and self.form._meta.exclude:
# Take the custom ModelForm's Meta.exclude into account only if the # Take the custom ModelForm's Meta.exclude into account only if the