From e84a282aa607d56b354220a6ba01a2f0c4e344a8 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Mon, 10 Jan 2022 08:24:45 -0500 Subject: [PATCH] Revert REST API changes from #8284 --- docs/release-notes/version-3.1.md | 6 +++--- netbox/tenancy/api/serializers.py | 3 +-- netbox/tenancy/api/views.py | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/release-notes/version-3.1.md b/docs/release-notes/version-3.1.md index 64bb0c12e..459e62d60 100644 --- a/docs/release-notes/version-3.1.md +++ b/docs/release-notes/version-3.1.md @@ -4,12 +4,12 @@ ### Enhancements -* [#8262](https://github.com/netbox-community/netbox/issues/8262) - Add cables to tenant stats -* [#8265](https://github.com/netbox-community/netbox/issues/8265) - Add newer Stackwise-n interface types +* [#8262](https://github.com/netbox-community/netbox/issues/8262) - Add cable count to tenant stats +* [#8265](https://github.com/netbox-community/netbox/issues/8265) - Add Stackwise-n interface types ### Bug Fixes -* [#8287](https://github.com/netbox-community/netbox/issues/8287) - Correct label in Export Template Form +* [#8287](https://github.com/netbox-community/netbox/issues/8287) - Correct label in export template form --- diff --git a/netbox/tenancy/api/serializers.py b/netbox/tenancy/api/serializers.py index 0312949d1..a0482aa1d 100644 --- a/netbox/tenancy/api/serializers.py +++ b/netbox/tenancy/api/serializers.py @@ -40,14 +40,13 @@ class TenantSerializer(PrimaryModelSerializer): vlan_count = serializers.IntegerField(read_only=True) vrf_count = serializers.IntegerField(read_only=True) cluster_count = serializers.IntegerField(read_only=True) - cable_count = serializers.IntegerField(read_only=True) class Meta: model = Tenant fields = [ 'id', 'url', 'display', 'name', 'slug', 'group', 'description', 'comments', 'tags', 'custom_fields', 'created', 'last_updated', 'circuit_count', 'device_count', 'ipaddress_count', 'prefix_count', 'rack_count', - 'site_count', 'virtualmachine_count', 'vlan_count', 'vrf_count', 'cluster_count', 'cable_count', + 'site_count', 'virtualmachine_count', 'vlan_count', 'vrf_count', 'cluster_count', ] diff --git a/netbox/tenancy/api/views.py b/netbox/tenancy/api/views.py index f4b8abbf1..7e3358e7f 100644 --- a/netbox/tenancy/api/views.py +++ b/netbox/tenancy/api/views.py @@ -47,8 +47,7 @@ class TenantViewSet(CustomFieldModelViewSet): site_count=count_related(Site, 'tenant'), virtualmachine_count=count_related(VirtualMachine, 'tenant'), vlan_count=count_related(VLAN, 'tenant'), - vrf_count=count_related(VRF, 'tenant'), - cable_count=count_related(Cable, 'tenant') + vrf_count=count_related(VRF, 'tenant') ) serializer_class = serializers.TenantSerializer filterset_class = filtersets.TenantFilterSet