Skip to content

Commit 3f42336

Browse files
committed
EditorJsTextField null
1 parent 63c0252 commit 3f42336

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

django_editorjs_fields/fields.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ class EditorJsTextField(EditorJsFieldMixin, FieldMixin):
6767
def __init__(self, plugins=None, tools=None, **kwargs):
6868
super().__init__(plugins, tools, **kwargs)
6969

70+
def clean(self, value, model_instance):
71+
if value == 'null':
72+
value = None
73+
74+
return super().clean(value, model_instance)
75+
7076

7177
class EditorJsJSONField(EditorJsFieldMixin, JSONField if HAS_JSONFIELD else FieldMixin):
7278
# pylint: disable=useless-super-delegation

0 commit comments

Comments
 (0)