mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38:19 +02:00
Fix encoded attachment's filenames
This commit is contained in:
parent
e1b0763a46
commit
571f57d957
1 changed files with 3 additions and 1 deletions
|
|
@ -647,7 +647,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue