We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cbfed83 commit 0e3c35aCopy full SHA for 0e3c35a
netbox/netbox/views/generic/object_views.py
@@ -339,10 +339,14 @@ def _get_dependent_objects(self, obj):
339
340
# Compile a mapping of models to instances
341
dependent_objects = defaultdict(list)
342
- for model, instance in collector.instances_with_model():
+ for model, instances in collector.instances_with_model():
343
+ # Ignore relations to auto-created models (e.g. many-to-many mappings)
344
+ if model._meta.auto_created:
345
+ continue
346
# Omit the root object
- if instance != obj:
- dependent_objects[model].append(instance)
347
+ if instances == obj:
348
349
+ dependent_objects[model].append(instances)
350
351
return dict(dependent_objects)
352
0 commit comments