Skip to content
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

Remove django-compressor storage #11

Merged
merged 1 commit into from Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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