1
0
Fork 0

Return unicode-converted filename only if a response was returned.

This commit is contained in:
Adam Coddington 2016-05-14 22:29:23 -07:00
parent 5134b38060
commit a00f837150

View file

@ -724,7 +724,10 @@ class MessageAttachment(models.Model):
"""Returns the original filename of this attachment.""" """Returns the original filename of this attachment."""
file_name = self._get_rehydrated_headers().get_filename() file_name = self._get_rehydrated_headers().get_filename()
if isinstance(file_name, six.text_type): 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: else:
return None return None