summaryrefslogtreecommitdiff
path: root/service/pixelated
diff options
context:
space:
mode:
authorDenis Costa <deniscostadsc@gmail.com>2016-09-28 11:07:14 -0300
committerDenis Costa <deniscostadsc@gmail.com>2016-09-28 11:07:36 -0300
commit37366d260344955bd422e996a57c2052ac3ef57c (patch)
treee23d6536ab09c8bd1e8c5d9cbf09307e97fce106 /service/pixelated
parent663241d3add5dca912efac9c080181ede94dbe9f (diff)
Adds fallback to previous way to get body message.
Diffstat (limited to 'service/pixelated')
-rw-r--r--service/pixelated/adapter/model/mail.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/service/pixelated/adapter/model/mail.py b/service/pixelated/adapter/model/mail.py
index 949301cb..18be9362 100644
--- a/service/pixelated/adapter/model/mail.py
+++ b/service/pixelated/adapter/model/mail.py
@@ -213,6 +213,10 @@ class InputMail(Mail):
input_mail._mime_multipart.attach(payload)
if payload.get_content_type() == 'text/plain':
content_charset = payload.get_content_charset()
- input_mail.body = unicode(payload.get_payload(decode=True), content_charset)
+ try:
+ input_mail.body = unicode(
+ payload.get_payload(decode=True), content_charset)
+ except TypeError:
+ input_mail.body = unicode(payload.get_payload(decode=True))
input_mail._mime = input_mail.to_mime_multipart()
return input_mail