mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-13 02:58:17 -06:00
Revert changes
This commit is contained in:
parent
7d4d347ff0
commit
1d741b79e1
@ -207,9 +207,6 @@ class ConfigRevisionForm(BootstrapMixin, forms.ModelForm, metaclass=ConfigFormMe
|
||||
help_text += _(' (default)')
|
||||
self.fields[param.name].help_text = help_text
|
||||
|
||||
# Use the parameter-specific encoder
|
||||
self.fields[param.name].encoder = param.encoder
|
||||
|
||||
def save(self, commit=True):
|
||||
instance = super().save(commit=False)
|
||||
|
||||
|
@ -1,15 +1,8 @@
|
||||
import json
|
||||
|
||||
from django import forms
|
||||
from django.contrib.postgres.forms import SimpleArrayField
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class PrettyJSONEncoder(json.JSONEncoder):
|
||||
def __init__(self, indent, sort_keys, *args, **kwargs):
|
||||
super().__init__(indent=4, sort_keys=True, *args, **kwargs)
|
||||
|
||||
|
||||
class ConfigParam:
|
||||
|
||||
def __init__(self, name, label, default, description='', field=None, field_kwargs=None):
|
||||
@ -19,7 +12,6 @@ class ConfigParam:
|
||||
self.field = field or forms.CharField
|
||||
self.description = description
|
||||
self.field_kwargs = field_kwargs or {}
|
||||
self.encoder = PrettyJSONEncoder if self.field == forms.JSONField else None
|
||||
|
||||
|
||||
PARAMS = (
|
||||
|
Loading…
Reference in New Issue
Block a user