def handle_xblock_callback(request, course_id, usage_id, handler, suffix=None):
 if (not request.user.is_authenticated()):
  return HttpResponse('Unauthenticated', status=403)
 try:
  course_key = CourseKey.from_string(course_id)
 except InvalidKeyError:
  raise Http404('Invalid location')
 with modulestore().bulk_operations(course_key):
  try:
   course = modulestore().get_course(course_key)
  except ItemNotFoundError:
   raise Http404('invalid location')
  return _invoke_xblock_handler(request, course_id, usage_id, handler, suffix, course=course)

def handle_xblock_callback ( request , course_id , usage_id , handler , suffix = None ) : if ( not request . user . is_authenticated ( ) ) : return HttpResponse ( 'Unauthenticated' , status = 403 ) try : course_key = CourseKey . from_string ( course_id ) except InvalidKeyError : raise Http404 ( 'Invalid location' ) with modulestore ( ) . bulk_operations ( course_key ) : try : course = modulestore ( ) . get_course ( course_key ) except ItemNotFoundError : raise Http404 ( 'invalid location' ) return _invoke_xblock_handler ( request , course_id , usage_id , handler , suffix , course = course )
generic view for extensions .