From d476fa96ac1a91b5dbb9cf735665bb8755d1ee2a Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 28 Mar 2017 17:58:10 -0400 Subject: [PATCH] [1.11.x] Refs #18974 -- Added stacklevel for permalink() deprecation. Backport of b59c0d722d9b498e840feea6e2e88238d3dadf54 from master --- django/db/models/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/db/models/__init__.py b/django/db/models/__init__.py index 8ab11b098ad..06806fcdc4c 100644 --- a/django/db/models/__init__.py +++ b/django/db/models/__init__.py @@ -48,7 +48,8 @@ def permalink(func): warnings.warn( 'permalink() is deprecated in favor of calling django.urls.reverse() ' 'in the decorated method.', - RemovedInDjango21Warning + RemovedInDjango21Warning, + stacklevel=2, ) @wraps(func)