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