From ff916f02bca079d1884a0a2e7ecb2af56fdb4477 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 8 Oct 2018 15:34:42 +0200 Subject: [PATCH] Use stacklevel=2 with exclude_from_schema DeprecationWarning --- rest_framework/decorators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/decorators.py b/rest_framework/decorators.py index 2d3bbe46f..bd62b5300 100644 --- a/rest_framework/decorators.py +++ b/rest_framework/decorators.py @@ -81,7 +81,7 @@ def api_view(http_method_names=None, exclude_from_schema=False): warnings.warn( "The `exclude_from_schema` argument to `api_view` is deprecated. " "Use the `schema` decorator instead, passing `None`.", - DeprecationWarning + DeprecationWarning, stacklevel=2 ) WrappedAPIView.exclude_from_schema = exclude_from_schema