Don't remove '/' from id when it's not in the path
parent
7edafcfab8
commit
2a8a16edb8
|
|
@ -313,6 +313,9 @@ class PolymorphicParentModelAdmin(admin.ModelAdmin):
|
||||||
# See if the path started with an ID.
|
# See if the path started with an ID.
|
||||||
try:
|
try:
|
||||||
pos = path.find('/')
|
pos = path.find('/')
|
||||||
|
if pos == -1:
|
||||||
|
object_id = long(path)
|
||||||
|
else:
|
||||||
object_id = long(path[0:pos])
|
object_id = long(path[0:pos])
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise Http404("No ct_id parameter, unable to find admin subclass for path '{0}'.".format(path))
|
raise Http404("No ct_id parameter, unable to find admin subclass for path '{0}'.".format(path))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue