I have a polymorphic model Question with a submodel OpenQuestion. I use the following InlineAdmin:
class QuestionInline(SortableHiddenMixin, NestedStackedPolymorphicInline):
model = Question
class OpenQuestionInline(SortableHiddenMixin, NestedStackedPolymorphicInline.Child):
model = OpenQuestion
fields = (("description", "weight"), "position")
child_inlines = (OpenQuestionInline,)
def has_change_permission(self, request, obj=None):
return False
def has_add_permission(self, request, obj=None):
return False
def has_delete_permission(self, request, obj=None):
return False
However, I can still change the description and weight field of the open question.
I'm also able to reorder them. When I save the object, these changes are not saved, but I think I still shouldn't be allowed to change the values. I also tried adding the has_..._permission methods to the OpenQuestionInline, but it did not seem that they were called.
I also have the same issue. My configuration is exactly the same (minus the SortableMixin). Regardless, I can still edit fields even when explicitly returning False in has_change_permission.
I have a polymorphic model
Question
with a submodelOpenQuestion
. I use the followingInlineAdmin
:However, I can still change the
description
andweight
field of the open question. I'm also able to reorder them. When I save the object, these changes are not saved, but I think I still shouldn't be allowed to change the values. I also tried adding thehas_..._permission
methods to theOpenQuestionInline
, but it did not seem that they were called.