mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-23 16:06:43 -06:00
13809 fix ConfigRevision edit, check if custom validator JSON serializable
This commit is contained in:
parent
252bf03525
commit
d414304168
@ -531,6 +531,15 @@ class ConfigRevisionForm(BootstrapMixin, forms.ModelForm, metaclass=ConfigFormMe
|
||||
if type(value) in (tuple, list):
|
||||
value = ', '.join(value)
|
||||
self.fields[param.name].initial = value
|
||||
|
||||
if param.name == 'CUSTOM_VALIDATORS':
|
||||
# custom validators can be either dict or functions
|
||||
try:
|
||||
json.dumps(value)
|
||||
except TypeError:
|
||||
self.fields[param.name].initial = None
|
||||
self.fields[param.name].disabled = True
|
||||
|
||||
if is_static:
|
||||
self.fields[param.name].disabled = True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user