Skip to content

Commit

Permalink
Add distinct() to filtering VLANs by assigned interface (#18274)
Browse files Browse the repository at this point in the history
  • Loading branch information
thordreier authored Dec 27, 2024
1 parent 1691713 commit f03489f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions netbox/ipam/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,15 +1080,15 @@ 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:
return queryset.none()
return queryset.filter(
Q(vminterfaces_as_tagged=value) |
Q(vminterfaces_as_untagged=value)
)
).distinct()


class ServiceTemplateFilterSet(NetBoxModelFilterSet):
Expand Down

0 comments on commit f03489f

Please sign in to comment.