Skip to content

Commit

Permalink
Merge pull request #124 from benkonrath/fix-admin-500-error
Browse files Browse the repository at this point in the history
Don't remove '/' from id when it's not in the path
  • Loading branch information
vdboor committed Apr 8, 2015
2 parents 17c2445 + 2a8a16e commit 9efc5cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion polymorphic/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,10 @@ def subclass_view(self, request, path):
# 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))

Expand Down

0 comments on commit 9efc5cf

Please sign in to comment.