From 2c4a16369db610eaab21f9349ec915e5dcb18cff Mon Sep 17 00:00:00 2001 From: Aaron Tan Date: Thu, 23 Feb 2017 16:53:16 -0500 Subject: [PATCH] Restore original behavior of group children unattach. --- awx/api/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/awx/api/views.py b/awx/api/views.py index 33cff82049..bd0cef2696 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -1868,6 +1868,14 @@ class GroupChildrenList(EnforceParentRelationshipMixin, SubListCreateAttachDetac relationship = 'children' enforce_parent_relationship = 'inventory' + 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.delete() + return Response(status=status.HTTP_204_NO_CONTENT) + class GroupPotentialChildrenList(SubListAPIView):