Skip to content

Commit

Permalink
Fix compatibility with Django 5.1 (#180)
Browse files Browse the repository at this point in the history
Do not import get_storage_class() which is deprecated since
Django 4.2. 2048348 stopped using it on recent Django version
but did not remove the import so sass_processor stopped working
on the upcoming Django 5.1 which removes the get_storage_class()
function.
  • Loading branch information
washeck committed Mar 27, 2024
1 parent 17f9fb5 commit de8fdcb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sass_processor/storage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django import VERSION
from django.conf import settings
from django.contrib.staticfiles.finders import get_finders
from django.core.files.storage import FileSystemStorage, get_storage_class
from django.core.files.storage import FileSystemStorage
from django.utils.functional import LazyObject
from django.utils.module_loading import import_string

Expand All @@ -17,6 +17,7 @@ def _setup(self):
storage_options = sass_processor_storage.get("OPTIONS") or {}
storage_class = import_string(storage_path)
else:
from django.core.files.storage import get_storage_class
staticfiles_storage_backend = settings.STATICFILES_STORAGE
storage_path = getattr(settings, 'SASS_PROCESSOR_STORAGE', staticfiles_storage_backend)
storage_options = getattr(settings, 'SASS_PROCESSOR_STORAGE_OPTIONS', {})
Expand Down

0 comments on commit de8fdcb

Please sign in to comment.