From ee1de426074a28672fbc082f99348891a5df302d Mon Sep 17 00:00:00 2001 From: Thor Dreier-Hansen <43479811+thordreier@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:54:49 +0100 Subject: [PATCH] Add distinct() to filtering VLANs by assigned interface --- netbox/ipam/filtersets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/ipam/filtersets.py b/netbox/ipam/filtersets.py index 894219c646a..317d63e0569 100644 --- a/netbox/ipam/filtersets.py +++ b/netbox/ipam/filtersets.py @@ -1078,7 +1078,7 @@ def filter_interface_id(self, queryset, name, value): return queryset.filter( Q(interfaces_as_tagged=value) | Q(interfaces_as_untagged=value) - ) + ).distinct() def filter_vminterface_id(self, queryset, name, value): if value is None: @@ -1086,7 +1086,7 @@ def filter_vminterface_id(self, queryset, name, value): return queryset.filter( Q(vminterfaces_as_tagged=value) | Q(vminterfaces_as_untagged=value) - ) + ).distinct() class ServiceTemplateFilterSet(NetBoxModelFilterSet):