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

[#96] Fixing handling for unicode filename retrieval on python 2.

This commit is contained in:
Adam Coddington 2016-05-14 23:31:55 -07:00
parent a9b7f2d171
commit 1c29cefa08
2 changed files with 7 additions and 7 deletions

View file

@ -723,7 +723,7 @@ class MessageAttachment(models.Model):
def get_filename(self):
"""Returns the original filename of this attachment."""
file_name = self._get_rehydrated_headers().get_filename()
if isinstance(file_name, six.text_type):
if isinstance(file_name, six.string_types):
result = utils.convert_header_to_unicode(file_name)
if result is None:
return file_name