Преглед изворни кода

Fixes #7446: Fix exception when viewing a large number of child IPs within a prefix

jeremystretch пре 4 година
родитељ
комит
e09024e86f
2 измењених фајлова са 2 додато и 1 уклоњено
  1. 1 0
      docs/release-notes/version-3.0.md
  2. 1 1
      netbox/utilities/tables.py

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

@@ -5,6 +5,7 @@
 ### Bug Fixes
 
 * [#7442](https://github.com/netbox-community/netbox/issues/7442) - Fix missing actions column on user-configured tables
+* [#7446](https://github.com/netbox-community/netbox/issues/7446) - Fix exception when viewing a large number of child IPs within a prefix
 
 ---
 

+ 1 - 1
netbox/utilities/tables.py

@@ -130,7 +130,7 @@ class BaseTable(tables.Table):
         prefixes/IP addresses/etc., where some table rows may represent available address space.
         """
         if not hasattr(self, '_objects_count'):
-            self._objects_count = sum(1 for obj in self.data if getattr(obj, 'pk'))
+            self._objects_count = sum(1 for obj in self.data if hasattr(obj, 'pk'))
         return self._objects_count