From 2a8a16edb8e3bad0bf5a8ea77a8db08fb0232472 Mon Sep 17 00:00:00 2001 From: Ben Konrath Date: Mon, 2 Mar 2015 11:24:50 +0100 Subject: [PATCH] Don't remove '/' from id when it's not in the path --- polymorphic/admin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/polymorphic/admin.py b/polymorphic/admin.py index c534297..2799233 100644 --- a/polymorphic/admin.py +++ b/polymorphic/admin.py @@ -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))