From e55ce29c5f55f1e3ed0d07eaecc6601e4f31c3a6 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sun, 14 Oct 2018 02:50:32 -0400 Subject: [PATCH] Make sure email messages are always of data type bytes. Signed-off-by: Roberto Rosario --- mayan/apps/sources/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mayan/apps/sources/models.py b/mayan/apps/sources/models.py index 2c60648d32..c9dabe23e2 100644 --- a/mayan/apps/sources/models.py +++ b/mayan/apps/sources/models.py @@ -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: