From e09024e86f68dbd60f1c32b94abd6a64d54e7cc6 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 5 Oct 2021 12:07:03 -0400 Subject: [PATCH] Fixes #7446: Fix exception when viewing a large number of child IPs within a prefix --- docs/release-notes/version-3.0.md | 1 + netbox/utilities/tables.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 1e718a226..6b72482e2 100644 --- a/docs/release-notes/version-3.0.md +++ b/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 --- diff --git a/netbox/utilities/tables.py b/netbox/utilities/tables.py index d37f24543..42c9ffb56 100644 --- a/netbox/utilities/tables.py +++ b/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