forked from mirror/django-mailbox
Merge pull request #38 from patipatini/attachment_filename_encoding
Fix encoded attachment's filenames
This commit is contained in:
commit
413c492db3
1 changed files with 3 additions and 1 deletions
|
|
@ -662,7 +662,9 @@ class MessageAttachment(models.Model):
|
||||||
|
|
||||||
def get_filename(self):
|
def get_filename(self):
|
||||||
file_name = self._get_rehydrated_headers().get_filename()
|
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)
|
return convert_header_to_unicode(file_name)
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue