1
0
mirror of https://github.com/django/django.git synced 2025-01-28 19:19:20 +00:00

[5.0.x] Refs #26029 -- Improved get_storage_class() deprecation warning with stacklevel=2.

Addition of the `stacklevel` argument shows the source of the
deprecated call, making updating the client code simpler.
This commit is contained in:
Carlton Gibson 2023-10-10 10:28:23 +02:00 committed by GitHub
parent 33ad36a8ec
commit fa6e6f3113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,11 @@ GET_STORAGE_CLASS_DEPRECATED_MSG = (
def get_storage_class(import_path=None):
warnings.warn(GET_STORAGE_CLASS_DEPRECATED_MSG, RemovedInDjango51Warning)
warnings.warn(
GET_STORAGE_CLASS_DEPRECATED_MSG,
RemovedInDjango51Warning,
stacklevel=2,
)
return import_string(import_path or settings.DEFAULT_FILE_STORAGE)