Skip to content

Commit

Permalink
Add distinct() to filtering VLANs by assigned interface
Browse files Browse the repository at this point in the history
  • Loading branch information
thordreier committed Oct 30, 2024
1 parent 1e5f79a commit ee1de42
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 @@ -1078,15 +1078,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 ee1de42

Please sign in to comment.