Commits

Michael Elsdörfer committed 9075127

has_related_objects() now ignores parent classes.

Comments (0)

Files changed (1)

djutils/models/__init__.py

         # those in it's ``django.contrib.admin.util.NestedObjects`` class.
         if so_klass._meta.auto_created:
             continue
-        # Also ignore any subclasses (in case of inheritance).
-        if issubclass(so_klass, model):
+        # Also ignore any parent/child-classes (in case of inheritance).
+        if issubclass(so_klass, model) or issubclass(model, so_klass):
             continue
         # Does the user explicitely ask us to ignore this model?
         if so_klass in ignore: