1
0
Fork 0

Fix encoded attachment's filenames

This commit is contained in:
Philippe 2014-12-15 14:50:14 +01:00
parent e1b0763a46
commit 571f57d957

View file

@ -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