def regenerate_certificates(request, course_key, statuses_to_regenerate):
 task_type = 'regenerate_certificates_all_student'
 task_input = {}
 task_input.update({'statuses_to_regenerate': statuses_to_regenerate})
 task_class = generate_certificates
 task_key = ''
 instructor_task = submit_task(request, task_type, task_class, course_key, task_input, task_key)
 CertificateGenerationHistory.objects.create(course_id=course_key, generated_by=request.user, instructor_task=instructor_task, is_regeneration=True)
 return instructor_task

def regenerate_certificates ( request , course_key , statuses_to_regenerate ) : task_type = 'regenerate_certificates_all_student' task_input = { } task_input . update ( { 'statuses_to_regenerate' : statuses_to_regenerate } ) task_class = generate_certificates task_key = '' instructor_task = submit_task ( request , task_type , task_class , course_key , task_input , task_key ) CertificateGenerationHistory . objects . create ( course_id = course_key , generated_by = request . user , instructor_task = instructor_task , is_regeneration = True ) return instructor_task
submits a task to regenerate certificates for given students enrolled in the course .