From 6333e7d842b2640fd81dc4391aaa9bd51cc97f56 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Tue, 19 Nov 2019 09:37:55 +0000 Subject: [PATCH] Added an instance of force_text() to ensure non_ascii mail subjects are unicode when used for string interpolation, rather than bytes (which will trigger ascii decode()). - Legacy-Id: 17055 --- ietf/utils/mail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ietf/utils/mail.py b/ietf/utils/mail.py index d7f5a0b08..4c295a17d 100644 --- a/ietf/utils/mail.py +++ b/ietf/utils/mail.py @@ -313,7 +313,7 @@ def show_that_mail_was_sent(request,leadline,msg,bcc): from ietf.ietfauth.utils import has_role if has_role(request.user,['Area Director','Secretariat','IANA','RFC Editor','ISE','IAD','IRTF Chair','WG Chair','RG Chair','WG Secretary','RG Secretary']): info = "%s at %s %s\n" % (leadline,datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),settings.TIME_ZONE) - info += "Subject: %s\n" % msg.get('Subject','[no subject]') + info += "Subject: %s\n" % force_text(msg.get('Subject','[no subject]')) info += "To: %s\n" % msg.get('To','[no to]') if msg.get('Cc'): info += "Cc: %s\n" % msg.get('Cc')