[Django] #26911: RedirectView failing silently on NoReverseMatch is confusing

7 views
Skip to first unread message

Django

unread,
Jul 18, 2016, 5:55:05 PM7/18/16
to django-...@googlegroups.com
#26911: RedirectView failing silently on NoReverseMatch is confusing
-------------------------------+--------------------
Reporter: Adys | Owner: nobody
Type: Uncategorized | Status: new
Component: Generic views | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
Relevant code:
https://github.com/django/django/blob/bc53af13cbf09b0cbac945426c2d51d0ca52fff3/django/views/generic/base.py#L176-L180
(failing the if on line 196)

I'm taking the time to open this ticket because this wasted me a lot of
time. I had a typo in my `pattern_name`, which resulted in a 410 rather
than an exception (as one would expect).

The documentation only says a 410 will be returned if "the resulting
location is empty, or the url argument is None", but doesn't mention that
it can mask errors.

This design should be reconsidered (per the zen of python, errors should
never pass silently). Or at the very least, documented.

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

Django

unread,
Jul 19, 2016, 7:29:57 AM7/19/16
to django-...@googlegroups.com
#26911: RedirectView failing silently on NoReverseMatch is confusing
--------------------------------------+------------------------------------
Reporter: Adys | Owner: nobody
Type: Cleanup/optimization | Status: new

Component: Generic views | Version: 1.10
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 timgraham):

* needs_better_patch: => 0
* needs_docs: => 0
* type: Uncategorized => Cleanup/optimization
* needs_tests: => 0
* stage: Unreviewed => Accepted


Comment:

I don't see a rationale for that decision on the original ticket: #15273.
You'll need to write to the DevelopersMailingList to see if there's
consensus to change it, otherwise updating the documentation will suffice.

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

Django

unread,
Feb 23, 2017, 2:26:06 PM2/23/17
to django-...@googlegroups.com
#26911: RedirectView failing silently on NoReverseMatch is confusing
--------------------------------------+------------------------------------
Reporter: Jerome Leclanche | Owner: K2
Type: Cleanup/optimization | Status: assigned

Component: Generic views | Version: 1.10
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 K2):

* cc: grzegorz.tezycki@… (added)
* owner: nobody => K2
* status: new => assigned


Comment:

Catching NoReverseMatch will be removed

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

Django

unread,
Mar 1, 2017, 7:10:13 AM3/1/17
to django-...@googlegroups.com
#26911: Remove NoReverseMatch silencing in RedirectView

--------------------------------------+------------------------------------
Reporter: Jerome Leclanche | Owner: K2
Type: Cleanup/optimization | Status: assigned
Component: Generic views | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/8125 PR]

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

Django

unread,
Mar 1, 2017, 5:29:30 PM3/1/17
to django-...@googlegroups.com
#26911: Remove NoReverseMatch silencing in RedirectView
--------------------------------------+------------------------------------
Reporter: Jerome Leclanche | Owner: K2
Type: Cleanup/optimization | Status: closed

Component: Generic views | Version: 1.10
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"fede65260aaf3a5100d1c07de771707dd50b1f35" fede6526]:
{{{
#!CommitTicketReference repository=""
revision="fede65260aaf3a5100d1c07de771707dd50b1f35"
Fixed #26911 -- Removed NoReverseMatch silencing in RedirectView.
}}}

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

Reply all
Reply to author
Forward
0 new messages