From 22980cea7ba264b42f1a119235e6928e5c8f5f40 Mon Sep 17 00:00:00 2001 From: kkthxbye <> Date: Mon, 21 Mar 2022 10:46:51 +0100 Subject: [PATCH] Speed up rendering of the script list --- netbox/extras/views.py | 2 ++ netbox/templates/extras/script_list.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/netbox/extras/views.py b/netbox/extras/views.py index cc53c465d..ae43ac489 100644 --- a/netbox/extras/views.py +++ b/netbox/extras/views.py @@ -753,6 +753,8 @@ class ScriptListView(ContentTypePermissionRequiredMixin, View): for _scripts in scripts.values(): for script in _scripts.values(): + # Prevent django from instantiating the class on all accesses + script.do_not_call_in_templates = True script.result = results.get(script.full_name) return render(request, 'extras/script_list.html', { diff --git a/netbox/templates/extras/script_list.html b/netbox/templates/extras/script_list.html index ccbdca705..a6f6833c9 100644 --- a/netbox/templates/extras/script_list.html +++ b/netbox/templates/extras/script_list.html @@ -34,7 +34,7 @@ {% for class_name, script in module_scripts.items %}