Skip to content

Commit 80c2bcb

Browse files
committed
adding json dumps to schema to have proper json passed to the HTML that renders the widget
1 parent 7021abf commit 80c2bcb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

django_admin_json_editor/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from django import forms
55
from django.utils.safestring import mark_safe
66
from django.template.loader import render_to_string
7+
import json
78

89

910
class JSONEditorWidget(forms.Widget):
@@ -28,7 +29,7 @@ def render(self, name, value, attrs=None, renderer=None):
2829

2930
context = {
3031
'name': name,
31-
'schema': schema,
32+
'schema': json.dumps(schema),
3233
'data': value,
3334
'sceditor': int(self._sceditor),
3435
}

0 commit comments

Comments
 (0)