From 2877790b244779f708771e4f5ee793d75b7718bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 16 Nov 2019 18:36:50 +0100 Subject: [PATCH] emails: force_str() on html rendition of email (#36515) --- wcs/qommon/emails.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wcs/qommon/emails.py b/wcs/qommon/emails.py index 1555e3779..6e73180c9 100644 --- a/wcs/qommon/emails.py +++ b/wcs/qommon/emails.py @@ -46,6 +46,7 @@ from django.utils.six import StringIO from quixote import get_request, get_response, get_publisher from .publisher import get_cfg, get_logger +from . import force_str from . import errors from . import tokens from .admin.emails import EmailsDirectory @@ -182,7 +183,7 @@ def email(subject, mail_body, email_rcpt, replyto=None, bcc=None, config_section = None, enable_exit_status = None) # change paragraphs so manual newlines are considered. - htmlmail = htmlmail.replace('

', '

') + htmlmail = force_str(htmlmail).replace('

', '

') except: htmlmail = None