Skip to content

Commit

Permalink
Merge pull request #11 from ccnmtl/remove-compressor
Browse files Browse the repository at this point in the history
Remove django-compressor storage
  • Loading branch information
ndittren committed Feb 20, 2023
2 parents 0b5c03a + 991d3d5 commit 35b14a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGES
@@ -1,3 +1,7 @@
0.3.0
==================
* Remove django-compressor local_storage

0.2.2 (2020-07-16)
==================
* Update the seek of closed file fix to work with django-storages 1.9.x.
Expand Down
11 changes: 0 additions & 11 deletions cacheds3storage/__init__.py
@@ -1,16 +1,10 @@
import os
from django.core.files.storage import get_storage_class
from storages.backends.s3boto3 import S3Boto3Storage, SpooledTemporaryFile
from django.conf import settings
from dateutil import tz


class CachedS3BotoStorage(S3Boto3Storage):
def __init__(self, *args, **kwargs):
super(CachedS3BotoStorage, self).__init__(*args, **kwargs)
self.local_storage = get_storage_class(
'compressor.storage.CompressorFileStorage')()

# https://github.com/jschneier/django-storages/issues/382
# #issuecomment-592876060
def _save(self, name, content):
Expand All @@ -37,11 +31,6 @@ def _save(self, name, content):
return super(CachedS3BotoStorage, self)._save(
name, content_autoclose)

def save(self, name, content):
name = super(CachedS3BotoStorage, self).save(name, content)
self.local_storage._save(name, content)
return name

def modified_time(self, prefixed_path):
# S3Boto3Storage returns a UTC timestamp (which it gets from S3)
# but an offset-naive one.
Expand Down

0 comments on commit 35b14a1

Please sign in to comment.