mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 11:26:26 -06:00
Tweak getattr()
This commit is contained in:
parent
f81b0a7dab
commit
16d2e63dac
@ -571,7 +571,7 @@ class SystemView(UserPassesTestMixin, View):
|
|||||||
|
|
||||||
# Serialize any CustomValidator classes
|
# Serialize any CustomValidator classes
|
||||||
for attr in ['CUSTOM_VALIDATORS', 'PROTECTION_RULES']:
|
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))
|
setattr(config, attr, json.dumps(getattr(config, attr), cls=ConfigJSONEncoder, indent=4))
|
||||||
|
|
||||||
return render(request, 'core/system.html', {
|
return render(request, 'core/system.html', {
|
||||||
|
Loading…
Reference in New Issue
Block a user