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
This commit is contained in:
Jannis Leidel 2012-02-09 18:59:12 +00:00
parent 4dbeb4bca4
commit 55aa285a33
1 changed files with 2 additions and 1 deletions

View File

@ -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"