Ver Fonte

Closes #9261: NetBoxTable no longer automatically clears pre-existing calls to prefetch_related() on its queryset

jeremystretch há 3 anos atrás
pai
commit
61d756c7c4
2 ficheiros alterados com 5 adições e 1 exclusões
  1. 4 0
      docs/release-notes/version-3.3.md
  2. 1 1
      netbox/netbox/tables/tables.py

+ 4 - 0
docs/release-notes/version-3.3.md

@@ -7,6 +7,10 @@
 * [#8495](https://github.com/netbox-community/netbox/issues/8495) - Enable custom field grouping
 * [#8495](https://github.com/netbox-community/netbox/issues/8495) - Enable custom field grouping
 * [#8995](https://github.com/netbox-community/netbox/issues/8995) - Enable arbitrary ordering of REST API results
 * [#8995](https://github.com/netbox-community/netbox/issues/8995) - Enable arbitrary ordering of REST API results
 
 
+### Other Changes
+
+* [#9261](https://github.com/netbox-community/netbox/issues/9261) - `NetBoxTable` no longer automatically clears pre-existing calls to `prefetch_related()` on its queryset
+
 ### REST API Changes
 ### REST API Changes
 
 
 * extras.CustomField
 * extras.CustomField

+ 1 - 1
netbox/netbox/tables/tables.py

@@ -97,7 +97,7 @@ class BaseTable(tables.Table):
                             break
                             break
                     if prefetch_path:
                     if prefetch_path:
                         prefetch_fields.append('__'.join(prefetch_path))
                         prefetch_fields.append('__'.join(prefetch_path))
-            self.data.data = self.data.data.prefetch_related(None).prefetch_related(*prefetch_fields)
+            self.data.data = self.data.data.prefetch_related(*prefetch_fields)
 
 
     def _get_columns(self, visible=True):
     def _get_columns(self, visible=True):
         columns = []
         columns = []