Ticket #14414: ctviews.patch
File ctviews.patch, 731 bytes (added by , 14 years ago) |
---|
-
contenttypes/views.py
old new def shortcut(request, content_type_id, o 8 8 # Look up the object, making sure it's got a get_absolute_url() function. 9 9 try: 10 10 content_type = ContentType.objects.get(pk=content_type_id) 11 if not content_type.model_class(): 12 raise http.Http404("Content type %s object has no model associated with it" % content_type) 11 13 obj = content_type.get_object_for_this_type(pk=object_id) 12 14 except (ObjectDoesNotExist, ValueError): 13 15 raise http.Http404("Content type %s object %s doesn't exist" % (content_type_id, object_id))