1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-09 22:38:19 +02:00

Always read file object in as bytes; fixes bug in which non-local file storage caused get_email_object to fail.

This commit is contained in:
Adam Coddington 2015-04-13 20:13:24 -07:00
parent 4037aac5e4
commit 830343bf78
2 changed files with 4 additions and 3 deletions

View file

@ -1 +1 @@
__version__ = '4.3.2'
__version__ = '4.3.3'

View file

@ -621,8 +621,9 @@ class Message(models.Model):
def get_email_object(self):
""" Returns an `email.message.Message` instance for this message."""
if self.eml:
return email.message_from_file(self.eml)
body = self.get_body()
body = self.eml.file.read()
else:
body = self.get_body()
if six.PY3:
flat = email.message_from_bytes(body)
else: