@require_GET
@ensure_csrf_cookie
@login_required
@ensure_valid_course_key
def import_status_handler(request, course_key_string, filename=None):
 course_key = CourseKey.from_string(course_key_string)
 if (not has_course_author_access(request.user, course_key)):
  raise PermissionDenied()
 try:
  session_status = request.session['import_status']
  status = session_status[(course_key_string + filename)]
 except KeyError:
  status = 0
 return JsonResponse({'ImportStatus': status})

@ require_GET @ ensure_csrf_cookie @ login_required @ ensure_valid_course_key def import_status_handler ( request , course_key_string , filename = None ) : course_key = CourseKey . from_string ( course_key_string ) if ( not has_course_author_access ( request . user , course_key ) ) : raise PermissionDenied ( ) try : session_status = request . session [ 'import_status' ] status = session_status [ ( course_key_string + filename ) ] except KeyError : status = 0 return JsonResponse ( { 'ImportStatus' : status } )
returns an integer corresponding to the status of a file import .