Opened 11 years ago

Closed 11 years ago

#11268 closed (invalid)

django.contrib.admin.util.quote does not handle spaces (%20 -> _20)

Reported by: mcsmart Owned by: nobody
Component: contrib.admin Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no


I have a primary key that allows spaces, e.g., "foo bar", which comes
up in the admin list page properly, but the
URL becomes "" when I
expect it to become "
foo_20bar/". If you follow the link you'll get a debug page with:

Page not found (404)
Request Method: GET
Request URL:

mymodel object with primary key u'foo%20bar' does not exist.

It seems that django.contrib.admin.util.quote should convert spaces
along with the other characters it already does.

Attachments (1)

django_contrib_admin_util_quote.diff (948 bytes) - added by mcsmart 11 years ago.
Patch to trunk/django/contrib/admin/ for quote()

Download all attachments as: .zip

Change History (3)

Changed 11 years ago by mcsmart

Patch to trunk/django/contrib/admin/ for quote()

comment:1 Changed 11 years ago by Alex Gaynor

Needs tests: set

comment:2 Changed 11 years ago by mcsmart

Resolution: invalid
Status: newclosed

I was unable to reproduce this in a stripped down testcase. We worked around this in our project in another way, but I'm not convinced it's a Django bug. I will reopen if I come up with proof that this is broken in the base system.

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