-
Notifications
You must be signed in to change notification settings - Fork 170
add support of remote storage #303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
add support of remote storage #303
Conversation
4ace5da
to
a175bab
Compare
ef90206
to
0be2afd
Compare
97b5657
to
c08461c
Compare
@pfouque can we move forward with this PR? the bug is a real blocker when using Google Oauth2 |
Hi @badziyoussef, Additionally, merging doesn't necessarily mean a new release will be published soon. |
c08461c
to
0be2afd
Compare
Hi @pfouque, I splitted to two separate PR as requested, if you can check |
Hi @badziyoussef, |
output = BytesIO() | ||
encode_quopri( | ||
BytesIO( | ||
attachment.document.read() | ||
), | ||
output, | ||
quotetabs=True, | ||
header=False, | ||
) | ||
new.set_payload( | ||
output.getvalue().decode().replace(' ', '=20') | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be tested, but it's probably enough to make it compatible with remote storage
output = BytesIO() | |
encode_quopri( | |
BytesIO( | |
attachment.document.read() | |
), | |
output, | |
quotetabs=True, | |
header=False, | |
) | |
new.set_payload( | |
output.getvalue().decode().replace(' ', '=20') | |
) | |
with attachment.document.open('rb') as f: | |
output = BytesIO() | |
encode_quopri( | |
BytesIO( | |
f.read() | |
), | |
output, | |
quotetabs=True, | |
header=False, | |
) | |
new.set_payload( | |
output.getvalue().decode().replace(' ', '=20') |
del new['Content-Transfer-Encoding'] | ||
new['Content-Transfer-Encoding'] = 'quoted-printable' | ||
else: | ||
with open(attachment.document.path, 'rb') as f: | ||
new.set_payload(f.read()) | ||
new.set_payload(attachment.document.read()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be tested, but it's probably enough to make it compatible with remote storage
new.set_payload(attachment.document.read()) | |
with attachment.document.open('rb') as f: | |
new.set_payload(f.read()) |
Actually, the package is not compatible with django-storages, which is a valuable feature, as django can run in production in a scallable environment, actually with django-storages it raise (see screenshot bellow)