form: use force_str() on wysiwyg fields (#36515)

This commit is contained in:
Frédéric Péters 2019-11-16 16:43:17 +01:00
parent e45c19e794
commit 30a9d2d4c3
1 changed files with 1 additions and 1 deletions

View File

@ -1488,7 +1488,7 @@ class WysiwygTextWidget(TextWidget):
parser = HTMLParser()
charset = get_publisher().site_charset
def unquote_django(matchobj):
return parser.unescape(force_text(matchobj.group(0), charset)).encode(charset)
return force_str(parser.unescape(force_text(matchobj.group(0), charset)))
self.value = re.sub('{[{%](.*?)[%}]}', unquote_django, self.value)
def add_media(self):