From 8cbf60e3b728db7d4a7e47d7dfb9148bbf0f8799 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Thu, 22 May 2014 14:57:39 -0400 Subject: [PATCH] Integrate a new overall disassociate to /groups/n/children --- awx/api/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/awx/api/views.py b/awx/api/views.py index b143d26533..8689471152 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -762,6 +762,14 @@ class GroupChildrenList(SubListCreateAPIView): parent_model = Group relationship = 'children' + def unattach(self, request, *args, **kwargs): + sub_id = request.DATA.get('id', None) + if sub_id is not None: + return super(GroupChildrenList, self).unattach(request, *args, **kwargs) + parent = self.get_parent_object() + parent.mark_inactive() + return Response(status=status.HTTP_204_NO_CONTENT) + def _unattach(self, request, *args, **kwargs): # FIXME: Disabled for now for UI support. ''' Special case for disassociating a child group from the parent. If the