1
0
Fork 0

[#96] Decode attachment filenames into unicodes.

This commit is contained in:
Adam Coddington 2016-05-14 22:19:03 -07:00
parent b4a3cdc843
commit 276917c6e6
2 changed files with 26 additions and 3 deletions

View file

@ -724,9 +724,7 @@ class MessageAttachment(models.Model):
"""Returns the original filename of this attachment."""
file_name = self._get_rehydrated_headers().get_filename()
if isinstance(file_name, six.text_type):
return file_name
elif file_name:
return convert_header_to_unicode(file_name)
return utils.convert_header_to_unicode(file_name)
else:
return None