@must_be_valid_project
@must_have_permission(ADMIN)
@must_not_be_registration
def component_remove(auth, node, **kwargs):
 try:
  node.remove_node(auth)
 except NodeStateError as e:
  raise HTTPError(http.BAD_REQUEST, data={'message_short': 'Error', 'message_long': ('Could not delete component: ' + e.message)})
 node.save()
 message = '{} has been successfully deleted.'.format(node.project_or_component.capitalize())
 status.push_status_message(message, kind='success', trust=False)
 parent = node.parent_node
 if (parent and parent.can_view(auth)):
  redirect_url = node.parent_node.url
 else:
  redirect_url = '/dashboard/'
 return {'url': redirect_url}

@ must_be_valid_project @ must_have_permission ( ADMIN ) @ must_not_be_registration def component_remove ( auth , node , ** kwargs ) : try : node . remove_node ( auth ) except NodeStateError as e : raise HTTPError ( http . BAD_REQUEST , data = { 'message_short' : 'Error' , 'message_long' : ( 'Could not delete component: ' + e . message ) } ) node . save ( ) message = '{} has been successfully deleted.' . format ( node . project_or_component . capitalize ( ) ) status . push_status_message ( message , kind = 'success' , trust = False ) parent = node . parent_node if ( parent and parent . can_view ( auth ) ) : redirect_url = node . parent_node . url else : redirect_url = '/dashboard/' return { 'url' : redirect_url }
remove component .