Opened 5 years ago

Closed 5 years ago

#30430 closed New feature (wontfix)

Make the admin URL wrap() decorator accessible from anywhere.

Reported by: Aidas Bendoraitis Owned by: nobody
Component: contrib.admin Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In the get_urls() of ModelAdmin, there is a wrap() decorator defined. It checks permissions, manages caching, and deals with the CSRF protection.

I would find it useful to make the wrap() decorator accessible from an outer scope, because so when extending the get_urls() you could apply the decorator to new views without redefining it.

Change History (1)

comment:1 by Mariusz Felisiak, 5 years ago

Resolution: wontfix
Status: newclosed
Summary: Make the admin URL wrap decorator accessible from anywhereMake the admin URL wrap() decorator accessible from anywhere.
Version: 2.2master

Thanks, for the report, however I don't see much value in adding wrap() hook to the ModelAdmin.get_urls(), you can always use self.admin_site.admin_view() what is described in documentation.

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