From d61737396b38ec1a584174343cb45f27adbaaf57 Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Thu, 20 Nov 2025 19:37:14 +0100 Subject: [PATCH] fix(filtersets): Respect assigned object type for L2VPN terminations Add the `assigned_object_type_id` filter to `L2VPNTerminationFilterSet` so that the "Assigned object type" filter correctly restricts L2VPN terminations by their assigned object type, using the `ObjectType` model for lookups. Fixes #20844 --- netbox/vpn/filtersets.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/netbox/vpn/filtersets.py b/netbox/vpn/filtersets.py index d35831e2f..7a51f2d93 100644 --- a/netbox/vpn/filtersets.py +++ b/netbox/vpn/filtersets.py @@ -2,6 +2,7 @@ import django_filters from django.db.models import Q from django.utils.translation import gettext as _ +from core.models import ObjectType from dcim.models import Device, Interface from ipam.models import IPAddress, RouteTarget, VLAN from netbox.filtersets import NetBoxModelFilterSet, OrganizationalModelFilterSet @@ -429,6 +430,10 @@ class L2VPNTerminationFilterSet(NetBoxModelFilterSet): queryset=VLAN.objects.all(), label=_('VLAN (ID)'), ) + assigned_object_type_id = django_filters.ModelMultipleChoiceFilter( + queryset=ObjectType.objects.all(), + field_name='assigned_object_type' + ) assigned_object_type = ContentTypeFilter() class Meta: