13809 check json rendering for all fields

This commit is contained in:
Arthur 2023-09-20 07:28:23 -07:00
parent d414304168
commit 4e930a80ed

View File

@ -532,13 +532,11 @@ class ConfigRevisionForm(BootstrapMixin, forms.ModelForm, metaclass=ConfigFormMe
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
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