@transaction.non_atomic_requests
@require_POST
@ensure_csrf_cookie
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
@require_level('staff')
def get_students_who_may_enroll(request, course_id):
 course_key = CourseKey.from_string(course_id)
 query_features = ['email']
 try:
  lms.djangoapps.instructor_task.api.submit_calculate_may_enroll_csv(request, course_key, query_features)
  success_status = _('The enrollment report is being created. This report contains information about learners who can enroll in the course. To view the status of the report, see Pending Tasks below.')
  return JsonResponse({'status': success_status})
 except AlreadyRunningError:
  already_running_status = _('This enrollment report is currently being created. To view the status of the report, see Pending Tasks below. You will be able to download the report when it is complete.')
  return JsonResponse({'status': already_running_status})

@ transaction . non_atomic_requests @ require_POST @ ensure_csrf_cookie @ cache_control ( no_cache = True , no_store = True , must_revalidate = True ) @ require_level ( 'staff' ) def get_students_who_may_enroll ( request , course_id ) : course_key = CourseKey . from_string ( course_id ) query_features = [ 'email' ] try : lms . djangoapps . instructor_task . api . submit_calculate_may_enroll_csv ( request , course_key , query_features ) success_status = _ ( 'The enrollment report is being created. This report contains information about learners who can enroll in the course. To view the status of the report, see Pending Tasks below.' ) return JsonResponse ( { 'status' : success_status } ) except AlreadyRunningError : already_running_status = _ ( 'This enrollment report is currently being created. To view the status of the report, see Pending Tasks below. You will be able to download the report when it is complete.' ) return JsonResponse ( { 'status' : already_running_status } )
initiate generation of a csv file containing information about students who may enroll in a course .