@login_required
@ensure_csrf_cookie
@require_http_methods(('POST', 'PUT', 'DELETE'))
def signatory_detail_handler(request, course_key_string, certificate_id, signatory_id):
 course_key = CourseKey.from_string(course_key_string)
 store = modulestore()
 with store.bulk_operations(course_key):
  course = _get_course_and_check_access(course_key, request.user)
  certificates_list = course.certificates['certificates']
  match_cert = None
  for (index, cert) in enumerate(certificates_list):
   if (certificate_id is not None):
    if (int(cert['id']) == int(certificate_id)):
     match_cert = cert
  if (request.method == 'DELETE'):
   if (not match_cert):
    return JsonResponse(status=404)
   CertificateManager.remove_signatory(request=request, store=store, course=course, certificate_id=certificate_id, signatory_id=signatory_id)
   return JsonResponse(status=204)

@ login_required @ ensure_csrf_cookie @ require_http_methods ( ( 'POST' , 'PUT' , 'DELETE' ) ) def signatory_detail_handler ( request , course_key_string , certificate_id , signatory_id ) : course_key = CourseKey . from_string ( course_key_string ) store = modulestore ( ) with store . bulk_operations ( course_key ) : course = _get_course_and_check_access ( course_key , request . user ) certificates_list = course . certificates [ 'certificates' ] match_cert = None for ( index , cert ) in enumerate ( certificates_list ) : if ( certificate_id is not None ) : if ( int ( cert [ 'id' ] ) == int ( certificate_id ) ) : match_cert = cert if ( request . method == 'DELETE' ) : if ( not match_cert ) : return JsonResponse ( status = 404 ) CertificateManager . remove_signatory ( request = request , store = store , course = course , certificate_id = certificate_id , signatory_id = signatory_id ) return JsonResponse ( status = 204 )
json api endpoint for manipulating a specific course certificate signatory via its internal identifier .