def generate_user_certificates(student, course_key, course=None, insecure=False, generation_mode='batch', forced_grade=None):
 xqueue = XQueueCertInterface()
 if insecure:
  xqueue.use_https = False
 generate_pdf = (not has_html_certificates_enabled(course_key, course))
 cert = xqueue.add_cert(student, course_key, course=course, generate_pdf=generate_pdf, forced_grade=forced_grade)
 if (cert is None):
  return
 if CertificateStatuses.is_passing_status(cert.status):
  emit_certificate_event('created', student, course_key, course, {'user_id': student.id, 'course_id': unicode(course_key), 'certificate_id': cert.verify_uuid, 'enrollment_mode': cert.mode, 'generation_mode': generation_mode})
 return cert.status

def generate_user_certificates ( student , course_key , course = None , insecure = False , generation_mode = 'batch' , forced_grade = None ) : xqueue = XQueueCertInterface ( ) if insecure : xqueue . use_https = False generate_pdf = ( not has_html_certificates_enabled ( course_key , course ) ) cert = xqueue . add_cert ( student , course_key , course = course , generate_pdf = generate_pdf , forced_grade = forced_grade ) if ( cert is None ) : return if CertificateStatuses . is_passing_status ( cert . status ) : emit_certificate_event ( 'created' , student , course_key , course , { 'user_id' : student . id , 'course_id' : unicode ( course_key ) , 'certificate_id' : cert . verify_uuid , 'enrollment_mode' : cert . mode , 'generation_mode' : generation_mode } ) return cert . status
it will add the add-cert request into the xqueue .