'Leave a team
Leave a team.'

def delete(self, request, organization, member_id, team_slug):

    try:
        om = self._get_member(request, organization, member_id)
    except OrganizationMember.DoesNotExist:
        raise ResourceDoesNotExist
    if (not self._can_access(request, om)):
        return Response({'detail': ERR_INSUFFICIENT_ROLE}, status=400)
    try:
        team = Team.objects.get(organization=organization, slug=team_slug)
    except Team.DoesNotExist:
        raise ResourceDoesNotExist
    try:
        omt = OrganizationMemberTeam.objects.get(team=team, organizationmember=om)
    except OrganizationMemberTeam.DoesNotExist:
        pass
    else:
        self.create_audit_entry(request=request, organization=organization, target_object=omt.id, target_user=om.user, event=AuditLogEntryEvent.MEMBER_LEAVE_TEAM, data=omt.get_audit_log_data())
        omt.delete()
    return Response(serialize(team, request.user, TeamWithProjectsSerializer()), status=200)
