Opened 9 years ago

Closed 7 years ago

#6371 closed (fixed)

several decorators don't work with bound methods

Reported by: Gary Wilson Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Similar to #4376, there are several other decorators that don't work with bound methods. A few that I noticed were cache_page, cache_control, and never_cache from django.views.decorators.cache. cache_page uses decorator_from_middleware, and other decorators created with this "decorator generator" have the same problem. They are django.views.decorators.gzip.gzip_page and django.views.decorators.http.conditional_page.

There might be others lurking out there...

Change History (4)

comment:1 Changed 9 years ago by Mihai Damian

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

@cache_page works for shure, just tested it last night

comment:2 Changed 8 years ago by Jacob

Triage Stage: UnreviewedAccepted

comment:3 Changed 7 years ago by Jacob

This also applies to the new etag, last_modified, and condition decorators.

comment:4 Changed 7 years ago by Luke Plant

Resolution: fixed
Status: newclosed

(In [11586]) Fixed #6371 - several decorators don't work with bound methods.

This involved changing the way the internal function
decorator_from_middleware works slightly, breaking some code that relied on
the old behaviour. As a result, it is much simpler, but cache_page has been
made slightly more complex to cope with the change.

Note: See TracTickets for help on using tickets.
Back to Top