We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 02df977 commit 69ea1cdCopy full SHA for 69ea1cd
1 file changed
netbox_custom_objects_tab/views/combined.py
@@ -56,8 +56,13 @@ def _iter_linked_fields(instance):
56
content_type = ContentType.objects.get_for_model(instance._meta.model)
57
type_choices = [CustomFieldTypeChoices.TYPE_OBJECT, CustomFieldTypeChoices.TYPE_MULTIOBJECT]
58
59
+ # is_polymorphic=False keeps the two querysets disjoint — a row with
60
+ # related_object_type set AND is_polymorphic=True (a legacy misconfig:
61
+ # is_polymorphic is immutable upstream but related_object_type isn't
62
+ # nulled when toggled) would otherwise be yielded twice.
63
non_poly = CustomObjectTypeField.objects.filter(
64
related_object_type=content_type,
65
+ is_polymorphic=False,
66
type__in=type_choices,
67
).select_related("custom_object_type")
68
0 commit comments