mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-17 12:42:52 -06:00
#12058: Fix initial JSON population
This commit is contained in:
parent
293afab730
commit
be55bb43ad
@ -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):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user