mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
#12058: Fix initial JSON population
This commit is contained in:
@ -254,6 +254,15 @@ class ConfigContextForm(BootstrapMixin, forms.ModelForm):
|
|||||||
'tenants', 'tags',
|
'tenants', 'tags',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def __init__(self, *args, initial=None, **kwargs):
|
||||||
|
|
||||||
|
# Convert data delivered via initial data to JSON data
|
||||||
|
if initial and 'data' in initial:
|
||||||
|
if type(initial['data']) is str:
|
||||||
|
initial['data'] = json.loads(initial['data'])
|
||||||
|
|
||||||
|
super().__init__(*args, initial=initial, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class ImageAttachmentForm(BootstrapMixin, forms.ModelForm):
|
class ImageAttachmentForm(BootstrapMixin, forms.ModelForm):
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user