diff --git a/docs/release-notes/version-2.8.md b/docs/release-notes/version-2.8.md index fb177252f..5dcb5f01f 100644 --- a/docs/release-notes/version-2.8.md +++ b/docs/release-notes/version-2.8.md @@ -5,6 +5,7 @@ ### Bug Fixes * [#4702](https://github.com/netbox-community/netbox/issues/4702) - Catch IntegrityError exception when adding a non-unique secret +* [#4707](https://github.com/netbox-community/netbox/issues/4707) - Fix `prefix_count` population on VLAN API serializer --- diff --git a/netbox/ipam/api/views.py b/netbox/ipam/api/views.py index bf430f633..dd3652b1f 100644 --- a/netbox/ipam/api/views.py +++ b/netbox/ipam/api/views.py @@ -276,7 +276,7 @@ class VLANViewSet(CustomFieldModelViewSet): queryset = VLAN.objects.prefetch_related( 'site', 'group', 'tenant', 'role', 'tags' ).annotate( - prefix_count=get_subquery(Prefix, 'role') + prefix_count=get_subquery(Prefix, 'vlan') ) serializer_class = serializers.VLANSerializer filterset_class = filters.VLANFilterSet