From 082d0cd796d33fc51be1355b2e5dfcd182b66925 Mon Sep 17 00:00:00 2001 From: Jeremy Bowers Date: Thu, 28 Sep 2017 09:41:00 -0400 Subject: [PATCH] Maybe it's already public? --- twilio_app.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/twilio_app.py b/twilio_app.py index e5d8b7b..513a187 100644 --- a/twilio_app.py +++ b/twilio_app.py @@ -271,12 +271,8 @@ def persist_file(filename, uploaded_file): ''' client = storage.Client() bucket = client.get_bucket('int.nyt.com') - local_filename = filename.split('/')[-1] - remote_path = '%s/%s' % ('apps/shazongress', local_filename) - blob = bucket.blob(remote_path) blob = bucket.blob(filename) - blob.upload_from_string(uploaded_file.read(), content_type="image/jpeg") - blob.make_public() + blob.upload_from_string(uploaded_file.read(), content_type="image/png") return blob.public_url.replace('apps%2Fshazongress%2F', 'apps/shazongress/') if __name__ == '__main__':