1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-09 22:38:19 +02:00

Adding missing import.

This commit is contained in:
Adam Coddington 2013-07-26 20:18:49 -07:00
parent 0f3cb09f94
commit f48abb0d14

View file

@ -1,4 +1,5 @@
import email
from email.header import decode_header
from email.message import Message as EmailMessage
from email.utils import formatdate, parseaddr
from email.encoders import encode_base64
@ -546,7 +547,7 @@ class MessageAttachment(models.Model):
def get_filename(self):
file_name = self._get_rehydrated_headers().get_filename()
if file_name:
encoded_subject, encoding = email.Header.decode_header(file_name)[0]
encoded_subject, encoding = decode_header(file_name)[0]
if encoding:
encoded_subject = encoded_subject.decode(encoding)
return encoded_subject