mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 11:26:26 -06:00
Configure PROTECTION_RULE config attribute to use ConfigJSONEncoder as serializer
This commit is contained in:
parent
3324d64813
commit
f81b0a7dab
@ -570,8 +570,9 @@ class SystemView(UserPassesTestMixin, View):
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
# Serialize any CustomValidator classes
|
# Serialize any CustomValidator classes
|
||||||
if hasattr(config, 'CUSTOM_VALIDATORS') and config.CUSTOM_VALIDATORS:
|
for attr in ['CUSTOM_VALIDATORS', 'PROTECTION_RULES']:
|
||||||
config.CUSTOM_VALIDATORS = json.dumps(config.CUSTOM_VALIDATORS, cls=ConfigJSONEncoder, indent=4)
|
if hasattr(config, attr) and getattr(config, attr):
|
||||||
|
setattr(config, attr, json.dumps(getattr(config, attr), cls=ConfigJSONEncoder, indent=4))
|
||||||
|
|
||||||
return render(request, 'core/system.html', {
|
return render(request, 'core/system.html', {
|
||||||
'stats': stats,
|
'stats': stats,
|
||||||
|
Loading…
Reference in New Issue
Block a user