diff --git a/nested_inline/admin.py b/nested_inline/admin.py index 68daca9..452a6f4 100644 --- a/nested_inline/admin.py +++ b/nested_inline/admin.py @@ -19,9 +19,12 @@ class InlineInstancesMixin(): + def get_inlines(self, request, obj): + return super().get_inlines(request, obj) if hasattr(super(), 'get_inlines') else self.inlines + def get_inline_instances(self, request, obj=None): inline_instances = [] - for inline_class in self.inlines: + for inline_class in self.get_inlines(request, obj): inline = inline_class(self.model, self.admin_site) if request: if VERSION < (2, 1, 0):