From 2a5b497d8abe5515d911fcca2dc7189715152ed7 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 30 Apr 2021 10:08:15 -0400 Subject: [PATCH] Fixes #6313: Fix device type instance count under manufacturer view --- docs/release-notes/version-2.11.md | 1 + netbox/dcim/views.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index f83875a4d..bad2ba7e3 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -10,6 +10,7 @@ * [#6308](https://github.com/netbox-community/netbox/issues/6308) - Fix linking of available VLANs in VLAN group view * [#6309](https://github.com/netbox-community/netbox/issues/6309) - Restrict parent VM interface assignment to the parent VM +* [#6313](https://github.com/netbox-community/netbox/issues/6313) - Fix device type instance count under manufacturer view --- diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py index 72438fc9a..734f9bd1a 100644 --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -692,6 +692,8 @@ class ManufacturerView(generic.ObjectView): def get_extra_context(self, request, instance): devicetypes = DeviceType.objects.restrict(request.user, 'view').filter( manufacturer=instance + ).annotate( + instance_count=count_related(Device, 'device_type') ) devicetypes_table = tables.DeviceTypeTable(devicetypes)