Opened 9 years ago

Closed 9 years ago

#25695 closed New feature (fixed)

csrf_failure view should take a template parameter

Reported by: Raphael Michel Owned by: Raphael Michel
Component: Uncategorized Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The default CSRF failure view (django.views.csrf.csrf_failure) should take an optional template parameter, just as the HTTP error views (e.g. django.views.defaults.page_not_found) do to make it easier to overwrite the view while retaining the template rendering context of the default view.

Currently, it is necessary to copy over the view to your own codebase, which is very unclean.

I will prepare a pull request for this ticket if it gets accepted.

Change History (4)

comment:1 by Florian Apolloner, 9 years ago

Triage Stage: UnreviewedAccepted

Sounds sensible, especially if pages like to integrate the CSRF error page with the style of their homepage

comment:2 by Raphael Michel, 9 years ago

Has patch: set
Owner: changed from nobody to Raphael Michel
Status: newassigned

I'd love to hear some feedback.

comment:3 by Simon Charette, 9 years ago

Triage Stage: AcceptedReady for checkin
Version: 1.8master

Patch LGTM.

comment:4 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 16945f0e:

Fixed #25695 -- Added template_name parameter to csrf_failure() view.

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