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

Merge pull request #38 from patipatini/attachment_filename_encoding

Fix encoded attachment's filenames
This commit is contained in:
Adam Coddington 2014-12-15 06:43:21 -08:00
commit 413c492db3

View file

@ -662,7 +662,9 @@ class MessageAttachment(models.Model):
def get_filename(self):
file_name = self._get_rehydrated_headers().get_filename()
if file_name:
if isinstance(file_name, six.text_type):
return file_name
elif file_name:
return convert_header_to_unicode(file_name)
else:
return None