1
0
Fork 0

Merge pull request #303 from badziyoussef/feature/add-support-remote-storage

add support of remote storage
This commit is contained in:
Pascal Fouque 2025-06-20 07:07:51 +02:00 committed by GitHub
commit eec7fb76f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -719,7 +719,7 @@ class Message(models.Model):
if encoding and encoding.lower() == 'quoted-printable': if encoding and encoding.lower() == 'quoted-printable':
# Cannot use `email.encoders.encode_quopri due to # Cannot use `email.encoders.encode_quopri due to
# bug 14360: http://bugs.python.org/issue14360 # bug 14360: http://bugs.python.org/issue14360
with open(attachment.document.path, 'rb') as f: with attachment.document.open('rb') as f:
output = BytesIO() output = BytesIO()
encode_quopri( encode_quopri(
BytesIO( BytesIO(
@ -735,7 +735,7 @@ class Message(models.Model):
del new['Content-Transfer-Encoding'] del new['Content-Transfer-Encoding']
new['Content-Transfer-Encoding'] = 'quoted-printable' new['Content-Transfer-Encoding'] = 'quoted-printable'
else: else:
with open(attachment.document.path, 'rb') as f: with attachment.document.open('rb') as f:
new.set_payload(f.read()) new.set_payload(f.read())
del new['Content-Transfer-Encoding'] del new['Content-Transfer-Encoding']
encode_base64(new) encode_base64(new)