def must_not_be_rejected(func):
 @functools.wraps(func)
 def wrapped(*args, **kwargs):
  node = get_or_http_error(Node, kwargs.get('nid', kwargs.get('pid')), allow_deleted=True)
  if (node.sanction and node.sanction.is_rejected):
   raise HTTPError(http.GONE, data=dict(message_long='This registration has been rejected'))
  return func(*args, **kwargs)
 return wrapped

def must_not_be_rejected ( func ) : @ functools . wraps ( func ) def wrapped ( * args , ** kwargs ) : node = get_or_http_error ( Node , kwargs . get ( 'nid' , kwargs . get ( 'pid' ) ) , allow_deleted = True ) if ( node . sanction and node . sanction . is_rejected ) : raise HTTPError ( http . GONE , data = dict ( message_long = 'This registration has been rejected' ) ) return func ( * args , ** kwargs ) return wrapped
ensures approval/disapproval requests cant reach sanctions that have already been rejected .