@must_be_valid_project
@must_have_permission(ADMIN)
def node_registration_retraction_post(auth, node, **kwargs):
 if node.is_pending_retraction:
  raise HTTPError(http.BAD_REQUEST, data={'message_short': 'Invalid Request', 'message_long': 'This registration is already pending withdrawal'})
 if (not node.is_registration):
  raise HTTPError(http.BAD_REQUEST, data={'message_short': 'Invalid Request', 'message_long': 'Withdrawal of non-registrations is not permitted.'})
 if (node.root is not node):
  raise HTTPError(http.BAD_REQUEST, data={'message_short': 'Invalid Request', 'message_long': 'Withdrawal of non-parent registrations is not permitted.'})
 data = request.get_json()
 try:
  node.retract_registration(auth.user, data.get('justification', None))
  node.save()
  node.retraction.ask(node.get_active_contributors_recursive(unique_users=True))
 except NodeStateError as err:
  raise HTTPError(http.FORBIDDEN, data=dict(message_long=err.message))
 return {'redirectUrl': node.web_url_for('view_project')}

@ must_be_valid_project @ must_have_permission ( ADMIN ) def node_registration_retraction_post ( auth , node , ** kwargs ) : if node . is_pending_retraction : raise HTTPError ( http . BAD_REQUEST , data = { 'message_short' : 'Invalid Request' , 'message_long' : 'This registration is already pending withdrawal' } ) if ( not node . is_registration ) : raise HTTPError ( http . BAD_REQUEST , data = { 'message_short' : 'Invalid Request' , 'message_long' : 'Withdrawal of non-registrations is not permitted.' } ) if ( node . root is not node ) : raise HTTPError ( http . BAD_REQUEST , data = { 'message_short' : 'Invalid Request' , 'message_long' : 'Withdrawal of non-parent registrations is not permitted.' } ) data = request . get_json ( ) try : node . retract_registration ( auth . user , data . get ( 'justification' , None ) ) node . save ( ) node . retraction . ask ( node . get_active_contributors_recursive ( unique_users = True ) ) except NodeStateError as err : raise HTTPError ( http . FORBIDDEN , data = dict ( message_long = err . message ) ) return { 'redirectUrl' : node . web_url_for ( 'view_project' ) }
handles retraction of public registrations .