django-froala-editor icon indicating copy to clipboard operation
django-froala-editor copied to clipboard

json encoding of option should use DjangoJSONEncoder

Open tisdall opened this issue 6 years ago • 0 comments

https://github.com/froala/django-froala-editor/blob/e70b402beab6611ad4d5a4ed46cb6ead1c2eec3d/froala_editor/widgets.py#L56

The json encoding should use django.core.serializers.json.DjangoJSONEncoder so lazy components from settings can properly be evaluated.

For example, I'm trying to set imageManagerLoadURL using reverse_lazy. However, the default encoding gives a traceback when it encounters the reverse_lazy. If it used DjangoJSONEncoder then it would work properly.

from django.core.serializers.json import DjangoJSONEncoder
json_options = json.dumps(options, cls=DjangoJSONEncoder)

tisdall avatar Oct 02 '19 14:10 tisdall