@expect_json
@login_required
@require_http_methods(('GET', 'POST', 'DELETE'))
def videos_handler(request, course_key_string, edx_video_id=None):
 course = _get_and_validate_course(course_key_string, request.user)
 if (not course):
  return HttpResponseNotFound()
 if (request.method == 'GET'):
  if ('application/json' in request.META.get('HTTP_ACCEPT', '')):
   return videos_index_json(course)
  else:
   return videos_index_html(course)
 elif (request.method == 'DELETE'):
  remove_video_for_course(course_key_string, edx_video_id)
  return JsonResponse()
 else:
  if is_status_update_request(request.json):
   return send_video_status_update(request.json)
  return videos_post(course, request)

@ expect_json @ login_required @ require_http_methods ( ( 'GET' , 'POST' , 'DELETE' ) ) def videos_handler ( request , course_key_string , edx_video_id = None ) : course = _get_and_validate_course ( course_key_string , request . user ) if ( not course ) : return HttpResponseNotFound ( ) if ( request . method == 'GET' ) : if ( 'application/json' in request . META . get ( 'HTTP_ACCEPT' , '' ) ) : return videos_index_json ( course ) else : return videos_index_html ( course ) elif ( request . method == 'DELETE' ) : remove_video_for_course ( course_key_string , edx_video_id ) return JsonResponse ( ) else : if is_status_update_request ( request . json ) : return send_video_status_update ( request . json ) return videos_post ( course , request )
the restful handler for video uploads .