Integrate a new overall disassociate to /groups/n/children

This commit is contained in:
Matthew Jones 2014-05-22 14:57:39 -04:00
parent e2fb427789
commit 8cbf60e3b7

View File

@ -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