From 5bdc4fa87bf9cc2d664300f483e4a3d16f5691e1 Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Wed, 8 Oct 2025 23:53:22 +0200 Subject: [PATCH] fix(graphql): Correct handling of `assigned` filter logic Updates `assigned` filter to dynamically generate keys using the `prefix` parameter. This addresses potential issues with prefixed filters and ensures accurate query construction. Fixes #20466 --- netbox/ipam/graphql/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/ipam/graphql/filters.py b/netbox/ipam/graphql/filters.py index 4b2431aa2d..50509d6a2b 100644 --- a/netbox/ipam/graphql/filters.py +++ b/netbox/ipam/graphql/filters.py @@ -170,7 +170,7 @@ class IPAddressFilter(ContactFilterMixin, TenancyFilterMixin, PrimaryModelFilter @strawberry_django.filter_field() def assigned(self, value: bool, prefix) -> Q: - return Q(assigned_object_id__isnull=(not value)) + return Q(**{f"{prefix}assigned_object_id__isnull": not value}) @strawberry_django.filter_field() def parent(self, value: list[str], prefix) -> Q: