Fixed passing Storage instance

This commit is contained in:
Tris Forster 2022-12-21 08:22:14 +11:00
parent 432118ac58
commit 227ce5fccb

View File

@ -18,8 +18,11 @@ class CachedStorage(Storage):
remote = getattr(settings, 'CACHED_STORAGE_REMOTE', None)
if not cachedir:
cachedir = getattr(settings, 'CACHED_STORAGE_DIR', 'cache')
self.remote = get_storage_class(remote)()
if isinstance(remote, Storage):
self.remote = remote
else:
self.remote = get_storage_class(remote)()
self.cachedir = cachedir
self.expires = expires