LeeHanYeong / django-quill-editor

django-quill-editor makes Quill.js easy to use on Django Forms and admin sites
https://django-quill-editor.readthedocs.io
MIT License
195 stars 46 forks source link

QuillField parse error if null #16

Closed michaldyczko closed 4 years ago

michaldyczko commented 4 years ago

If QuillField is not populated, it causes JSONParse error. It can be field by overriding FieldQuill.__init__ with:

def __init__(self, instance, field, json_string):
    json_string = json_string or '{"delta":"","html":""}'
    super().__init__(instance, field, json_string)

After that, QuillField blank and null arguments can be set to True.

LeeHanYeong commented 4 years ago

Thanks for the error report. Would you please send a PR if you have time? If you aren't familiar with PR, I'll update the new commit I mentioned you.

michaldyczko commented 4 years ago

Hi Lee, I will make a PR in a free time :)

LeeHanYeong commented 4 years ago

Merged c6b287739bbbf34105ceaf797e6fd1538082f0d4