def transaction_after_request(response, base_status_code_error=500):
 if view_has_annotation(NO_AUTO_TRANSACTION_ATTR):
  return response
 if (response.status_code >= base_status_code_error):
  exc_type = HTTPError
  exc_value = HTTPError(response.status_code)
  current_atomic.__exit__(exc_type, exc_value, None)
 else:
  current_atomic.__exit__(None, None, None)
 return response

def transaction_after_request ( response , base_status_code_error = 500 ) : if view_has_annotation ( NO_AUTO_TRANSACTION_ATTR ) : return response if ( response . status_code >= base_status_code_error ) : exc_type = HTTPError exc_value = HTTPError ( response . status_code ) current_atomic . __exit__ ( exc_type , exc_value , None ) else : current_atomic . __exit__ ( None , None , None ) return response
teardown transaction after handling the request .