Make sure email messages are always of data type bytes.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-10-14 02:50:32 -04:00
parent 9634ba75a6
commit e55ce29c5f

View File

@@ -14,7 +14,7 @@ from django.core.files import File
from django.core.files.base import ContentFile
from django.db import models, transaction
from django.utils.encoding import (
force_str, force_text, python_2_unicode_compatible
force_bytes, force_str, force_text, python_2_unicode_compatible
)
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
@@ -566,7 +566,7 @@ class EmailBaseModel(IntervalBaseModel):
from flanker import mime
counter = 1
message = mime.from_string(force_str(message_text))
message = mime.from_string(force_bytes(message_text))
metadata_dictionary = {}
if not message_properties: