@transaction.non_atomic_requests
@ensure_csrf_cookie
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
@require_global_staff
@require_POST
def generate_certificate_exceptions(request, course_id, generate_for=None):
 course_key = CourseKey.from_string(course_id)
 if (generate_for == 'all'):
  students = 'all_whitelisted'
 elif (generate_for == 'new'):
  students = 'whitelisted_not_generated'
 else:
  return JsonResponse({'success': False, 'message': _('Invalid data, generate_for must be "new" or "all".')}, status=400)
 lms.djangoapps.instructor_task.api.generate_certificates_for_students(request, course_key, student_set=students)
 response_payload = {'success': True, 'message': _('Certificate generation started for white listed students.')}
 return JsonResponse(response_payload)

@ transaction . non_atomic_requests @ ensure_csrf_cookie @ cache_control ( no_cache = True , no_store = True , must_revalidate = True ) @ require_global_staff @ require_POST def generate_certificate_exceptions ( request , course_id , generate_for = None ) : course_key = CourseKey . from_string ( course_id ) if ( generate_for == 'all' ) : students = 'all_whitelisted' elif ( generate_for == 'new' ) : students = 'whitelisted_not_generated' else : return JsonResponse ( { 'success' : False , 'message' : _ ( 'Invalid data, generate_for must be "new" or "all".' ) } , status = 400 ) lms . djangoapps . instructor_task . api . generate_certificates_for_students ( request , course_key , student_set = students ) response_payload = { 'success' : True , 'message' : _ ( 'Certificate generation started for white listed students.' ) } return JsonResponse ( response_payload )
generate certificate for students in the certificate white list .