forked from mirror/django-mailbox
Return unicode-converted filename only if a response was returned.
This commit is contained in:
parent
5134b38060
commit
a00f837150
1 changed files with 4 additions and 1 deletions
|
|
@ -724,7 +724,10 @@ 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 utils.convert_header_to_unicode(file_name)
|
||||
result = utils.convert_header_to_unicode(file_name)
|
||||
if result is None:
|
||||
return file_name
|
||||
return result
|
||||
else:
|
||||
return None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue