From 16d2e63dac4793cd1b216ffb6a24af69373d56bb Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 17 Jan 2025 13:47:43 -0500 Subject: [PATCH] Tweak getattr() --- netbox/core/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/core/views.py b/netbox/core/views.py index ee35be541..97fb692f6 100644 --- a/netbox/core/views.py +++ b/netbox/core/views.py @@ -571,7 +571,7 @@ class SystemView(UserPassesTestMixin, View): # Serialize any CustomValidator classes for attr in ['CUSTOM_VALIDATORS', 'PROTECTION_RULES']: - if hasattr(config, attr) and getattr(config, attr): + if hasattr(config, attr) and getattr(config, attr, None): setattr(config, attr, json.dumps(getattr(config, attr), cls=ConfigJSONEncoder, indent=4)) return render(request, 'core/system.html', {