Skip to content

Commit

Permalink
Fixed escaped text with HtmlField and parler
Browse files Browse the repository at this point in the history
  • Loading branch information
czpython committed Jul 5, 2017
1 parent 0037ff9 commit bd0575f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ CHANGELOG
* Introduced support for django CMS 3.5.0
* Fixed a regression which prevented multiple HTMLFields
from having different configurations.
* Fixed a bug where text coming from ``HtmlField`` was escaped
when using it with other third party apps like django-parler.


3.5.0 (2017-05-03)
Expand Down
4 changes: 3 additions & 1 deletion djangocms_text_ckeditor/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,7 @@ def formfield(self, **kwargs):
return super(HTMLField, self).formfield(**defaults)

def clean(self, value, model_instance):
# This needs to be marked safe as well because the form field's
# clean method is not called on model.full_clean()
value = super(HTMLField, self).clean(value, model_instance)
return clean_html(value, full=False)
return mark_safe(clean_html(value, full=False))

0 comments on commit bd0575f

Please sign in to comment.