@require_POST
def post_receive_hook_close_submitted(request, local_site_name=None, repository_id=None, hosting_service_id=None, hooks_uuid=None):
 repository = get_repository_for_hook(repository_id, hosting_service_id, local_site_name, hooks_uuid)
 try:
  payload = json.loads(request.body)
 except ValueError as e:
  logging.error(u'The payload is not in JSON format: %s', e, exc_info=1)
  return HttpResponseBadRequest(u'Invalid payload format')
 server_url = get_server_url(request=request)
 review_request_id_to_commits_map = close_review_requests(payload, server_url)
 if review_request_id_to_commits_map:
  close_all_review_requests(review_request_id_to_commits_map, local_site_name, repository, hosting_service_id)
 return HttpResponse()

@ require_POST def post_receive_hook_close_submitted ( request , local_site_name = None , repository_id = None , hosting_service_id = None , hooks_uuid = None ) : repository = get_repository_for_hook ( repository_id , hosting_service_id , local_site_name , hooks_uuid ) try : payload = json . loads ( request . body ) except ValueError as e : logging . error ( u'The payload is not in JSON format: %s' , e , exc_info = 1 ) return HttpResponseBadRequest ( u'Invalid payload format' ) server_url = get_server_url ( request = request ) review_request_id_to_commits_map = close_review_requests ( payload , server_url ) if review_request_id_to_commits_map : close_all_review_requests ( review_request_id_to_commits_map , local_site_name , repository , hosting_service_id ) return HttpResponse ( )
closes review requests as submitted automatically after a push .