File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -524,6 +524,14 @@ class ManifestStaticS3Storage(ManifestFilesMixin, StaticS3Storage):
524
524
"AWS_S3_MAX_AGE_SECONDS_CACHED" : 60 * 60 * 24 * 365 , # 1 year.
525
525
})
526
526
527
+ def _save (self , name , content ):
528
+ # See: https://github.com/etianen/django-s3-storage/issues/141
529
+ # Fix adapted from: https://github.com/jschneier/django-storages/pull/968
530
+ content .seek (0 )
531
+ with self .new_temporary_file () as tmp :
532
+ shutil .copyfileobj (content , tmp )
533
+ return super ()._save (name , File (tmp ))
534
+
527
535
def post_process (self , * args , ** kwargs ):
528
536
initial_aws_s3_max_age_seconds = self .settings .AWS_S3_MAX_AGE_SECONDS
529
537
self .settings .AWS_S3_MAX_AGE_SECONDS = self .settings .AWS_S3_MAX_AGE_SECONDS_CACHED
You can’t perform that action at this time.
0 commit comments