From 55aa285a339e3815bfec1077962e2bf4596a43bc Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 9 Feb 2012 18:59:12 +0000 Subject: [PATCH] Fixed #17643 -- Set a better stack level for the cache_page decorator deprecation warnings. Thanks, zsiciarz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17484 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/views/decorators/cache.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/views/decorators/cache.py b/django/views/decorators/cache.py index a39cc54e33..ea7a3b5ebf 100644 --- a/django/views/decorators/cache.py +++ b/django/views/decorators/cache.py @@ -44,7 +44,8 @@ def cache_page(*args, **kwargs): warnings.warn('The cache_page decorator must be called like: ' 'cache_page(timeout, [cache=cache name], [key_prefix=key prefix]). ' 'All other ways are deprecated.', - PendingDeprecationWarning) + PendingDeprecationWarning, + stacklevel=3) if len(args) > 1: assert len(args) == 2, "cache_page accepts at most 2 arguments"