Skip to content

Commit

Permalink
Use ModelAdmin.get_inlines()
Browse files Browse the repository at this point in the history
ModelAdmin uses a get function to allow overriding `self.inlines`. NestedModelAdmin ignores this override by accessing `self.inlines` directly. This PR fixes that.
  • Loading branch information
scottgigante authored Nov 22, 2023
1 parent 0671b6b commit 2965d9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nested_inline/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class InlineInstancesMixin():
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):
Expand Down

0 comments on commit 2965d9c

Please sign in to comment.