Don't remove '/' from id when it's not in the path

fix_request_path_info
Ben Konrath 2015-03-02 11:24:50 +01:00
parent 7edafcfab8
commit 2a8a16edb8
1 changed files with 4 additions and 1 deletions

View File

@ -313,7 +313,10 @@ class PolymorphicParentModelAdmin(admin.ModelAdmin):
# See if the path started with an ID.
try:
pos = path.find('/')
object_id = long(path[0:pos])
if pos == -1:
object_id = long(path)
else:
object_id = long(path[0:pos])
except ValueError:
raise Http404("No ct_id parameter, unable to find admin subclass for path '{0}'.".format(path))