Ticket #17643: patch_17643.diff

File patch_17643.diff, 696 bytes (added by zsiciarz, 4 years ago)

Setting correct stacklevel on the warnings.warn call.

  • django/views/decorators/cache.py

    diff --git a/django/views/decorators/cache.py b/django/views/decorators/cache.py
    index a39cc54..ea7a3b5 100644
    a b def cache_page(*args, **kwargs): 
    4444        warnings.warn('The cache_page decorator must be called like: '
    4545                      'cache_page(timeout, [cache=cache name], [key_prefix=key prefix]). '
    4646                      'All other ways are deprecated.',
    47                       PendingDeprecationWarning)
     47                      PendingDeprecationWarning,
     48                      stacklevel=3)
    4849
    4950    if len(args) > 1:
    5051        assert len(args) == 2, "cache_page accepts at most 2 arguments"
Back to Top