Commit 55aa285a authored by Jannis Leidel's avatar Jannis Leidel
Browse files

Fixed #17643 -- Set a better stack level for the cache_page decorator...

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
parent 4dbeb4bc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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"