Code

Opened 7 years ago

Closed 5 years ago

#6371 closed (fixed)

several decorators don't work with bound methods

Reported by: gwilson 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:

Description

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...

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by MihaiD

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

@cache_page works for shure, just tested it last night

comment:2 Changed 6 years ago by jacob

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 5 years ago by jacob

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

comment:4 Changed 5 years ago by lukeplant

  • Resolution set to fixed
  • Status changed from new to closed

(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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.