From cd38e785b2d4c717d973aff8a58b7c7fcbceca7d Mon Sep 17 00:00:00 2001 From: Diederik van der Boor Date: Thu, 6 Apr 2017 12:47:28 +0200 Subject: [PATCH] Add an explicit exclude for polymorphic_ctype in the PolymorphicInlineModelAdmin --- polymorphic/admin/inlines.py | 1 + 1 file changed, 1 insertion(+) diff --git a/polymorphic/admin/inlines.py b/polymorphic/admin/inlines.py index 1a1d434..7e163f4 100644 --- a/polymorphic/admin/inlines.py +++ b/polymorphic/admin/inlines.py @@ -223,6 +223,7 @@ class PolymorphicInlineModelAdmin(InlineModelAdmin): exclude = list(self.exclude) 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: # Take the custom ModelForm's Meta.exclude into account only if the