mirror of
https://github.com/django/django.git
synced 2025-06-07 20:49:11 +00:00
[4.2.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. Backport of fa6e6f31137ee4025adfb27f88c07eebd488d446 from stable/5.0.x.
This commit is contained in:
parent
9c7627da30
commit
0cbc92bc3a
@ -29,7 +29,11 @@ GET_STORAGE_CLASS_DEPRECATED_MSG = (
|
|||||||
|
|
||||||
|
|
||||||
def get_storage_class(import_path=None):
|
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)
|
return import_string(import_path or settings.DEFAULT_FILE_STORAGE)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user