mirror of
https://github.com/netbox-community/netbox.git
synced 2026-03-21 08:59:44 +01:00
* Remove the json filter for protection rules * Configure PROTECTION_RULE config attribute to use ConfigJSONEncoder as serializer * Tweak getattr() --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
@@ -570,8 +570,9 @@ class SystemView(UserPassesTestMixin, View):
|
||||
return response
|
||||
|
||||
# Serialize any CustomValidator classes
|
||||
if hasattr(config, 'CUSTOM_VALIDATORS') and config.CUSTOM_VALIDATORS:
|
||||
config.CUSTOM_VALIDATORS = json.dumps(config.CUSTOM_VALIDATORS, cls=ConfigJSONEncoder, indent=4)
|
||||
for attr in ['CUSTOM_VALIDATORS', 'PROTECTION_RULES']:
|
||||
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', {
|
||||
'stats': stats,
|
||||
|
||||
Reference in New Issue
Block a user