Merge pull request #124 from benkonrath/fix-admin-500-error

Don't remove '/' from id when it's not in the path
fix_request_path_info
Diederik van der Boor 2015-04-08 13:35:25 +02:00
commit 9efc5cfcb2
1 changed files with 4 additions and 1 deletions

View File

@ -323,7 +323,10 @@ 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('/')
object_id = long(path[0:pos]) if pos == -1:
object_id = long(path)
else:
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))