Ticket #14414: ctviews.patch

File ctviews.patch, 731 bytes (added by Yeago, 14 years ago)
  • contenttypes/views.py

    old new def shortcut(request, content_type_id, o  
    88    # Look up the object, making sure it's got a get_absolute_url() function.
    99    try:
    1010        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)
    1113        obj = content_type.get_object_for_this_type(pk=object_id)
    1214    except (ObjectDoesNotExist, ValueError):
    1315        raise http.Http404("Content type %s object %s doesn't exist" % (content_type_id, object_id))
Back to Top