summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2009-12-19 15:31:28 +0000
committerLuke Plant <L.Plant.98@cantab.net>2009-12-19 15:31:28 +0000
commitb15d762d7a03477384efea992de18adc1d2500ea (patch)
treefa1baded10ab021682a5a86c8ba223812d3f86fd /django
parentc81f1da152817153dced7d9fe577c38d2ef01de6 (diff)
[1.1.X] Fixed #10927 - Content Types shortcut view throws 500s instead of 404s
Thanks to Jeremy Dunck/Alex Gaynor for the patch Backport of r11917 from trunk git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@11919 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/contrib/contenttypes/views.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/contenttypes/views.py b/django/contrib/contenttypes/views.py
index 4285be36cc..26961201cd 100644
--- a/django/contrib/contenttypes/views.py
+++ b/django/contrib/contenttypes/views.py
@@ -9,7 +9,7 @@ def shortcut(request, content_type_id, object_id):
try:
content_type = ContentType.objects.get(pk=content_type_id)
obj = content_type.get_object_for_this_type(pk=object_id)
- except ObjectDoesNotExist:
+ except (ObjectDoesNotExist, ValueError):
raise http.Http404("Content type %s object %s doesn't exist" % (content_type_id, object_id))
try:
absurl = obj.get_absolute_url()