8000 fix: Remove deprecated `get_storage_class` import from `cms.utils` by fsbraun · Pull Request #8102 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

fix: Remove deprecated get_storage_class import from cms.utils #8102

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

Merged
merged 8 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
django-4.0.txt,
django-4.1.txt,
django-4.2.txt,
django-5.0.txt
django-5.0.txt,
django-5.1.txt
]
os: [
ubuntu-20.04,
Expand All @@ -28,6 +29,10 @@ jobs:
python-version: 3.8
- requirements-file: django-5.0.txt
python-version: 3.9
- requirements-file: django-5.1.txt
python-version: 3.8
- requirements-file: django-5.1.txt
python-version: 3.9

services:
postgres:
Expand Down Expand Up @@ -76,7 +81,8 @@ jobs:
django-4.0.txt,
django-4.1.txt,
django-4.2.txt,
django-5.0.txt
django-5.0.txt,
django-5.1.txt
]
os: [
ubuntu-20.04,
Expand All @@ -86,6 +92,10 @@ jobs:
python-version: 3.8
- requirements-file: django-5.0.txt
python-version: 3.9
- requirements-file: django-5.1.txt
python-version: 3.8
- requirements-file: django-5.1.txt
python-version: 3.9

services:
mysql:
Expand Down Expand Up @@ -134,7 +144,8 @@ jobs:
django-4.0.txt,
django-4.1.txt,
django-4.2.txt,
django-5.0.txt
django-5.0.txt,
django-5.1.txt
]
os: [
ubuntu-20.04,
Expand All @@ -144,6 +155,10 @@ jobs:
python-version: 3.8
- requirements-file: django-5.0.txt
python-version: 3.9
- requirements-file: django-5.1.txt
python-version: 3.8
- requirements-file: django-5.1.txt
python-version: 3.9

steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 3 additions & 2 deletions cms/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# TODO: this is just stuff from utils.py - should be split / moved
from django.conf import settings
from django.core.files.storage import get_storage_class
from django.utils.functional import LazyObject

from cms.utils.conf import get_site_id # nopyflakes
Expand Down Expand Up @@ -54,7 +53,9 @@ def get_language_from_request(request, current_page=None):

class ConfiguredStorage(LazyObject):
def _setup(self):
self._wrapped = get_storage_class(getattr(settings, 'STATICFILES_STORAGE', default_storage))()
from django.utils.module_loading import import_string

self._wrapped = import_string(getattr(settings, 'STATICFILES_STORAGE', default_storage))()


configured_storage = ConfiguredStorage()
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ skip = package-lock.json,*.js,*.po,./node_modules/*,./.idea/*,./docs/env/*,./doc

[options]
install_requires =
Django>=3.2
Django>=3.2,<5.2
python_requires = >=3.7

2 changes: 2 additions & 0 deletions test_requirements/django-5.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r requirements_base.txt
Django>=5.1,<5.2
Loading
0