Browse Source

Fixes #6313: Fix device type instance count under manufacturer view

jeremystretch 4 năm trước cách đây
mục cha
commit
2a5b497d8a

+ 1 - 0
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
 * [#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
 * [#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
 
 
 ---
 ---
 
 

+ 2 - 0
netbox/dcim/views.py

@@ -692,6 +692,8 @@ class ManufacturerView(generic.ObjectView):
     def get_extra_context(self, request, instance):
     def get_extra_context(self, request, instance):
         devicetypes = DeviceType.objects.restrict(request.user, 'view').filter(
         devicetypes = DeviceType.objects.restrict(request.user, 'view').filter(
             manufacturer=instance
             manufacturer=instance
+        ).annotate(
+            instance_count=count_related(Device, 'device_type')
         )
         )
 
 
         devicetypes_table = tables.DeviceTypeTable(devicetypes)
         devicetypes_table = tables.DeviceTypeTable(devicetypes)