Add distinct() to filtering VLANs by assigned interface

This commit is contained in:
Thor Dreier-Hansen 2024-10-30 15:54:49 +01:00
parent 1e5f79a8ed
commit ee1de42607

View File

@ -1078,7 +1078,7 @@ class VLANFilterSet(NetBoxModelFilterSet, TenancyFilterSet):
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 @@ class VLANFilterSet(NetBoxModelFilterSet, TenancyFilterSet):
return queryset.filter(
Q(vminterfaces_as_tagged=value) |
Q(vminterfaces_as_untagged=value)
)
).distinct()
class ServiceTemplateFilterSet(NetBoxModelFilterSet):