Skip to content

Commit ccefee6

Browse files
committed
adapt inlnies behavior
1 parent 3db4abd commit ccefee6

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/polymorphic/admin/inlines.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,7 @@ class PolymorphicInlineModelAdmin(InlineModelAdmin):
5353

5454
#: Inlines for all model sub types that can be displayed in this inline.
5555
#: Each row is a :class:`PolymorphicInlineModelAdmin.Child`
56-
child_inlines = None
57-
58-
#: The models that should be excluded from the auto-discovered leaf
59-
#: model sub types that can be displayed in this inline. This can be
60-
#: a list of models or a single model. It's useful to exclude
61-
#: non-abstract base models (abstract models are always excluded)
62-
#: when they don't have defined any child models.
63-
exclude_children = None
56+
child_inlines = ()
6457

6558
def __init__(self, parent_model, admin_site):
6659
super().__init__(parent_model, admin_site)
@@ -91,9 +84,7 @@ def get_child_inlines(self):
9184
This should return a list of tuples, exactly like
9285
:attr:`child_inlines` is.
9386
"""
94-
if self.child_inlines is not None:
95-
return self.child_inlines
96-
return ()
87+
return self.child_inlines or ()
9788

9889
def get_child_inline_instances(self):
9990
"""

0 commit comments

Comments
 (0)