django.contrib.admin.util.quote does not handle spaces (%20 -> _20)
|Reported by:||mcsmart||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||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 "http://example.com/admin/myapp/mymodel/foo%20bar/" when I
expect it to become "http://example.com/admin/myapp/mymodel/
foo_20bar/". If you follow the link you'll get a debug page with:
Page not found (404)
Request Method: GET
Request URL: http://example.com/admin/myapp/mymodel/foo%20bar/
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.