Added conditional decoding of bytes subject text, before interpolating into a new unicode string.

- Legacy-Id: 16577
This commit is contained in:
Henrik Levkowetz 2019-07-22 18:19:55 +00:00
parent 7039520557
commit 07c5e33bc4

View file

@ -165,7 +165,7 @@ def copy_email(msg, to, toUser=False, originalBcc=None):
# Overwrite the From: header, so that the copy from a development or
# test server doesn't look like spam.
new['From'] = settings.DEFAULT_FROM_EMAIL
new['Subject'] = '[Django %s] %s' % (settings.SERVER_MODE, msg.get('Subject', '[no subject]'))
new['Subject'] = '[Django %s] %s' % (settings.SERVER_MODE, force_text(msg.get('Subject', '[no subject]')))
new['To'] = to
send_smtp(new)