Skip to content

Commit 134a692

Browse files
committed
Fixed detection of _get_base_polymorphic_model() for abstract intermediate classes.
1 parent 2cf410d commit 134a692

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

polymorphic_tree/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def _get_base_polymorphic_model(ChildModel):
2626
First model in the inheritance chain that inherited from the PolymorphicMPTTModel
2727
"""
2828
for Model in reversed(ChildModel.mro()):
29-
if isinstance(Model, PolymorphicMPTTModelBase) and Model is not PolymorphicMPTTModel:
29+
if (isinstance(Model, PolymorphicMPTTModelBase) and
30+
Model is not PolymorphicMPTTModel and
31+
not Model._meta.abstract):
3032
return Model
3133
return None
3234

0 commit comments

Comments
 (0)