Skip to content

Commit

Permalink
Fix get_inlines method being ignored (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
pawnhearts authored Dec 15, 2023
1 parent 0671b6b commit 14fddfe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nested_inline/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 14fddfe

Please sign in to comment.