1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #4707: Fix prefix_count population on VLAN API serializer

This commit is contained in:
Jeremy Stretch
2020-06-02 13:40:14 -04:00
parent edf15532d2
commit 56f6698ba5
2 changed files with 2 additions and 1 deletions

View File

@ -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
---

View File

@ -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