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:
parent
0f3cb09f94
commit
f48abb0d14
1 changed files with 2 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
import email
|
import email
|
||||||
|
from email.header import decode_header
|
||||||
from email.message import Message as EmailMessage
|
from email.message import Message as EmailMessage
|
||||||
from email.utils import formatdate, parseaddr
|
from email.utils import formatdate, parseaddr
|
||||||
from email.encoders import encode_base64
|
from email.encoders import encode_base64
|
||||||
|
|
@ -546,7 +547,7 @@ class MessageAttachment(models.Model):
|
||||||
def get_filename(self):
|
def get_filename(self):
|
||||||
file_name = self._get_rehydrated_headers().get_filename()
|
file_name = self._get_rehydrated_headers().get_filename()
|
||||||
if file_name:
|
if file_name:
|
||||||
encoded_subject, encoding = email.Header.decode_header(file_name)[0]
|
encoded_subject, encoding = decode_header(file_name)[0]
|
||||||
if encoding:
|
if encoding:
|
||||||
encoded_subject = encoded_subject.decode(encoding)
|
encoded_subject = encoded_subject.decode(encoding)
|
||||||
return encoded_subject
|
return encoded_subject
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue