Просмотр исходного кода

Fixes #8658: Fix display of assigned components under inventory item lists

jeremystretch 3 лет назад
Родитель
Сommit
ea88b040ec

+ 1 - 0
docs/release-notes/version-3.2.md

@@ -150,6 +150,7 @@ Where it is desired to limit the range of available VLANs within a group, users
 
 
 ### Bug Fixes (From Beta2)
 ### Bug Fixes (From Beta2)
 
 
+* [#8658](https://github.com/netbox-community/netbox/issues/8658) - Fix display of assigned components under inventory item lists
 * [#8838](https://github.com/netbox-community/netbox/issues/8838) - Fix FieldError exception during global search
 * [#8838](https://github.com/netbox-community/netbox/issues/8838) - Fix FieldError exception during global search
 * [#8845](https://github.com/netbox-community/netbox/issues/8845) - Correct default ASN formatting in table
 * [#8845](https://github.com/netbox-community/netbox/issues/8845) - Correct default ASN formatting in table
 * [#8869](https://github.com/netbox-community/netbox/issues/8869) - Fix NoReverseMatch exception when displaying tag w/assignments
 * [#8869](https://github.com/netbox-community/netbox/issues/8869) - Fix NoReverseMatch exception when displaying tag w/assignments

+ 0 - 1
netbox/dcim/tables/devices.py

@@ -772,7 +772,6 @@ class InventoryItemTable(DeviceComponentTable):
         linkify=True
         linkify=True
     )
     )
     component = tables.Column(
     component = tables.Column(
-        accessor=Accessor('component'),
         orderable=False,
         orderable=False,
         linkify=True
         linkify=True
     )
     )

+ 2 - 2
netbox/netbox/views/generic/object_views.py

@@ -545,7 +545,7 @@ class ComponentCreateView(GetReturnURLMixin, BaseObjectView):
 
 
     def get(self, request):
     def get(self, request):
         form, model_form = self.initialize_forms(request)
         form, model_form = self.initialize_forms(request)
-        instance = self.alter_object(self.queryset.model, request)
+        instance = self.alter_object(self.queryset.model(), request)
 
 
         return render(request, self.template_name, {
         return render(request, self.template_name, {
             'object': instance,
             'object': instance,
@@ -557,7 +557,7 @@ class ComponentCreateView(GetReturnURLMixin, BaseObjectView):
     def post(self, request):
     def post(self, request):
         logger = logging.getLogger('netbox.views.ComponentCreateView')
         logger = logging.getLogger('netbox.views.ComponentCreateView')
         form, model_form = self.initialize_forms(request)
         form, model_form = self.initialize_forms(request)
-        instance = self.alter_object(self.queryset.model, request)
+        instance = self.alter_object(self.queryset.model(), request)
 
 
         if form.is_valid():
         if form.is_valid():
             new_components = []
             new_components = []