Opened 7 years ago

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

Description

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 Changed 7 years ago by Florian Apolloner

Triage Stage: UnreviewedAccepted

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

comment:2 Changed 7 years ago by Raphael Michel

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

I'd love to hear some feedback.

https://github.com/django/django/pull/5577

comment:3 Changed 7 years ago by Simon Charette

Triage Stage: AcceptedReady for checkin
Version: 1.8master

Patch LGTM.

comment:4 Changed 7 years ago by Tim Graham <timograham@…>

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