Skip to content

Commit

Permalink
fixup! Include ModelBase subclasses in plugin base class hook condition
Browse files Browse the repository at this point in the history
  • Loading branch information
flaeppe committed Dec 8, 2023
1 parent 05116bf commit 983a752
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions mypy_django_plugin/lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,4 @@ def resolve_lazy_reference(


def is_model_type(info: TypeInfo) -> bool:
return info.metaclass_type is not None and (
# Using the model metaclass shipped by Django
info.metaclass_type.type.fullname == fullnames.MODEL_METACLASS_FULLNAME
# Using a custom model metaclass that inherits above
or info.metaclass_type.type.has_base(fullnames.MODEL_METACLASS_FULLNAME)
)
return info.metaclass_type is not None and info.metaclass_type.type.has_base(fullnames.MODEL_METACLASS_FULLNAME)

0 comments on commit 983a752

Please sign in to comment.