@ensure_csrf_cookie
def jump_to(_request, course_id, location):
 try:
  course_key = CourseKey.from_string(course_id)
  usage_key = UsageKey.from_string(location).replace(course_key=course_key)
 except InvalidKeyError:
  raise Http404(u'Invalid course_key or usage_key')
 try:
  redirect_url = get_redirect_url(course_key, usage_key)
  user = _request.user
  user_is_global_staff = GlobalStaff().has_user(user)
  user_is_enrolled = CourseEnrollment.is_enrolled(user, course_key)
  if (user_is_global_staff and (not user_is_enrolled)):
   redirect_url = get_redirect_url_for_global_staff(course_key, _next=redirect_url)
 except ItemNotFoundError:
  raise Http404(u'No data at this location: {0}'.format(usage_key))
 except NoPathToItem:
  raise Http404(u'This location is not in any class: {0}'.format(usage_key))
 return redirect(redirect_url)

@ ensure_csrf_cookie def jump_to ( _request , course_id , location ) : try : course_key = CourseKey . from_string ( course_id ) usage_key = UsageKey . from_string ( location ) . replace ( course_key = course_key ) except InvalidKeyError : raise Http404 ( u'Invalid course_key or usage_key' ) try : redirect_url = get_redirect_url ( course_key , usage_key ) user = _request . user user_is_global_staff = GlobalStaff ( ) . has_user ( user ) user_is_enrolled = CourseEnrollment . is_enrolled ( user , course_key ) if ( user_is_global_staff and ( not user_is_enrolled ) ) : redirect_url = get_redirect_url_for_global_staff ( course_key , _next = redirect_url ) except ItemNotFoundError : raise Http404 ( u'No data at this location: {0}' . format ( usage_key ) ) except NoPathToItem : raise Http404 ( u'This location is not in any class: {0}' . format ( usage_key ) ) return redirect ( redirect_url )
show the page that contains a specific location .