@require_POST
def process_post_receive_hook(request, *args, **kwargs):
 try:
  server_url = get_server_url(request=request)
  if (u'payload' in request.POST):
   payload = json.loads(request.POST[u'payload'])
   close_git_review_requests(payload, server_url)
  else:
   payload = json.loads(request.POST[u'commit'])
   close_svn_review_request(payload, server_url)
 except KeyError as e:
  logging.error(u'There is no JSON payload in the POST request.: %s', e)
  return HttpResponse(status=415)
 except ValueError as e:
  logging.error(u'The payload is not in JSON format: %s', e)
  return HttpResponse(status=415)
 return HttpResponse()

@ require_POST def process_post_receive_hook ( request , * args , ** kwargs ) : try : server_url = get_server_url ( request = request ) if ( u'payload' in request . POST ) : payload = json . loads ( request . POST [ u'payload' ] ) close_git_review_requests ( payload , server_url ) else : payload = json . loads ( request . POST [ u'commit' ] ) close_svn_review_request ( payload , server_url ) except KeyError as e : logging . error ( u'There is no JSON payload in the POST request.: %s' , e ) return HttpResponse ( status = 415 ) except ValueError as e : logging . error ( u'The payload is not in JSON format: %s' , e ) return HttpResponse ( status = 415 ) return HttpResponse ( )
closes review requests as submitted automatically after a push .