kopia lustrzana https://github.com/wagtail/wagtail
Update checks.py (#10462)
Prevent "RemovedInDjango51Warning: The DEFAULT_FILE_STORAGE setting is deprecated. Use STORAGES instead."pull/11120/head
rodzic
1c76db228c
commit
1fd4b86022
|
@ -4,6 +4,7 @@ Changelog
|
|||
5.3 (xx.xx.xxxx) - IN DEVELOPMENT
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
* Fix: Update system check for overwriting storage backends to recognise the `STORAGES` setting introduced in Django 4.2 (phijma-leukeleu)
|
||||
* Maintenance: Update BeautifulSoup upper bound to 4.12.x (scott-8)
|
||||
|
||||
|
||||
|
|
|
@ -754,6 +754,7 @@
|
|||
* Meghana Reddy
|
||||
* Chinedu Ihedioha
|
||||
* scott-8
|
||||
* phijma-leukeleu
|
||||
|
||||
## Translators
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ depth: 1
|
|||
|
||||
### Bug fixes
|
||||
|
||||
* ...
|
||||
* Update system check for overwriting storage backends to recognise the `STORAGES` setting introduced in Django 4.2 (phijma-leukeleu)
|
||||
|
||||
### Documentation
|
||||
|
||||
|
|
|
@ -188,8 +188,17 @@ def wagtail_admin_base_url_check(app_configs, **kwargs):
|
|||
@register("file_overwrite")
|
||||
def file_overwrite_check(app_configs, **kwargs):
|
||||
from django.conf import settings
|
||||
from django import VERSION as DJANGO_VERSION
|
||||
|
||||
file_storage = getattr(settings, "DEFAULT_FILE_STORAGE", None)
|
||||
if DJANGO_VERSION >= (5, 1):
|
||||
file_storage = getattr(settings, "STORAGES")["default"]["BACKEND"]
|
||||
elif DJANGO_VERSION >= (4, 2):
|
||||
try:
|
||||
file_storage = getattr(settings, "STORAGES")["default"]["BACKEND"]
|
||||
except AttributeError:
|
||||
file_storage = getattr(settings, "DEFAULT_FILE_STORAGE", None)
|
||||
else:
|
||||
file_storage = getattr(settings, "DEFAULT_FILE_STORAGE", None)
|
||||
|
||||
errors = []
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue