Updating remote storages documentation for CachedS3BotoStorage bug.

The example in the docs doesn't quite work as the file stored in
the "content" variable is already closed, and ends up spitting out
encoded data to the destination files. It was properly being sent
to S3, but not getting saved locally.

This saves the file locally first, then using local storage, opens
the file once again for the S3BotoStorage save call.
This commit is contained in:
Briggs Thompson 2016-03-07 21:37:27 -06:00
parent 38cbfdb389
commit 90b29b3072
1 changed files with 1 additions and 1 deletions

View File

@ -66,8 +66,8 @@ apps can be integrated.
"compressor.storage.CompressorFileStorage")()
def save(self, name, content):
name = super(CachedS3BotoStorage, self).save(name, content)
self.local_storage._save(name, content)
super(CachedS3BotoStorage, self).save(name, self.local_storage._open(name))
return name
#. Set your :attr:`~django.conf.settings.COMPRESS_STORAGE` and STATICFILES_STORAGE_