[Django] #25695: csrf_failure view should take a template parameter

5 views
Skip to first unread message

Django

unread,
Nov 7, 2015, 6:45:24 AM11/7/15
to django-...@googlegroups.com
#25695: csrf_failure view should take a template parameter
-------------------------------+--------------------
Reporter: raphaelm | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/25695>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 7, 2015, 6:48:18 AM11/7/15
to django-...@googlegroups.com
#25695: csrf_failure view should take a template parameter
-------------------------------+------------------------------------

Reporter: raphaelm | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by apollo13):

* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/25695#comment:1>

Django

unread,
Nov 7, 2015, 8:20:07 AM11/7/15
to django-...@googlegroups.com
#25695: csrf_failure view should take a template parameter
-------------------------------+------------------------------------
Reporter: raphaelm | Owner: raphaelm
Type: New feature | Status: assigned
Component: Uncategorized | Version: 1.8

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by raphaelm):

* owner: nobody => raphaelm
* status: new => assigned
* has_patch: 0 => 1


Comment:

I'd love to hear some feedback.

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

--
Ticket URL: <https://code.djangoproject.com/ticket/25695#comment:2>

Django

unread,
Nov 7, 2015, 10:42:00 AM11/7/15
to django-...@googlegroups.com
#25695: csrf_failure view should take a template parameter
-------------------------------------+-------------------------------------

Reporter: raphaelm | Owner: raphaelm
Type: New feature | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by charettes):

* version: 1.8 => master
* stage: Accepted => Ready for checkin


Comment:

Patch LGTM.

--
Ticket URL: <https://code.djangoproject.com/ticket/25695#comment:3>

Django

unread,
Nov 17, 2015, 2:30:02 PM11/17/15
to django-...@googlegroups.com
#25695: csrf_failure view should take a template parameter
-------------------------------------+-------------------------------------
Reporter: raphaelm | Owner: raphaelm
Type: New feature | Status: closed
Component: Uncategorized | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"16945f0e9c57aeabadb6f2e2f150a2687455be40" 16945f0e]:
{{{
#!CommitTicketReference repository=""
revision="16945f0e9c57aeabadb6f2e2f150a2687455be40"
Fixed #25695 -- Added template_name parameter to csrf_failure() view.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25695#comment:4>

Reply all
Reply to author
Forward
0 new messages