Opened 6 years ago

Closed 6 years ago

#27373 closed Cleanup/optimization (fixed)

Incorrect message on 404 debug page for an empty request path

Reported by: Mariusz Felisiak Owned by: Mariusz Felisiak
Component: Error reporting 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

If empty request path r'^$' is not in URL patterns, then message on 404 debug page is incorrect:

Using the URLconf defined in test_app.urls, Django tried these URL patterns, in this order:

    ^admin/
    ^__debug__/

The current URL, , didn't match any of these.

it should be (without double comma):

Using the URLconf defined in test_app.urls, Django tried these URL patterns, in this order:

    ^admin/
    ^__debug__/

The current URL, didn't match any of these.

Change History (7)

comment:1 Changed 6 years ago by Mariusz Felisiak

Has patch: set

comment:2 Changed 6 years ago by Robert Roskam

Your fix for this case (https://github.com/django/django/pull/7420/files) is questionable, IMO.

If your goal is to help the user determine the URL that they attempted to resolve, the double comma at least helps visually enclose the space that's trying to be resolved.

I would suspect that this case is most common for new Django users. If this case is difficult enough to communicate, it may be worth it to come up with a better overall message.

comment:3 Changed 6 years ago by Tim Graham

Patch needs improvement: set
Summary: Incorrect message on 404 debug pageIncorrect message on 404 debug page for an empty request path
Triage Stage: UnreviewedAccepted

I noticed this issue at one point and debated whether or not it was worth filing a ticket. It could be confusing, I guess.

comment:4 Changed 6 years ago by Mariusz Felisiak

Maybe sth like this:

<p>
  {% if request_path %}
    The current URL, <code>{{ request_path|escape }}</code>,
  {% else %}
    The empty URL
  {% endif %}didn't match any of these.
</p>

will be better message.

comment:5 Changed 6 years ago by Mariusz Felisiak

Patch needs improvement: unset

comment:6 Changed 6 years ago by Tim Graham

Triage Stage: AcceptedReady for checkin

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

Resolution: fixed
Status: assignedclosed

In c7f86d3e:

Fixed #27373 -- Corrected 404 debug page message for an empty request path.

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