﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6470	Admin urls should use urlpatterns	jdetaeye	Alex Gaynor	"
If your model has a string as key, there are some admin change pages that are not accessible.

If the primary key of your object ends in ""add"", ""history"" or ""delete"", you can't access the change form any more.

Culprit is the following code in admin\options.py, responsible for parsing the URL:
{{{
        if url is None:
            return self.changelist_view(request)
        elif url.endswith('add'):
            return self.add_view(request)
        elif url.endswith('history'):
            return self.history_view(request, unquote(url[:-8]))
        elif url.endswith('delete'):
            return self.delete_view(request, unquote(url[:-7]))
        else:
            return self.change_view(request, unquote(url))
}}}

A corrected version is:
{{{
        if url is None:
            return self.changelist_view(request)
        elif url == 'add':
            return self.add_view(request)
        elif url.endswith('/history'):
            return self.history_view(request, unquote(url[:-8]))
        elif url.endswith('/delete'):
            return self.delete_view(request, unquote(url[:-7]))
        else:
            return self.change_view(request, unquote(url))
}}}

This applies also to the current admin, but in the current only an object with a key equal to ""add"" will not be accessible (since the url processing is better). "		closed	contrib.admin	dev		fixed	nfa-someday	schlaber@… jay.wineinger@… carl@… ross@…	Accepted	1	0	0	0	0	0
