From 7927b7678dd66c6729b197acf89fc1ae5f84de16 Mon Sep 17 00:00:00 2001 From: Nikhil <118773738+pablohashescobar@users.noreply.github.com> Date: Thu, 22 Feb 2024 20:22:03 +0530 Subject: [PATCH] [WEB - 508] chore: bot filter (#3751) * dev: update bot filters * dev: remove bot filters from workspace * filter out bot members in workspace * dev: remove filtering from project member listing * dev: update filtering for bot workspace members --------- Co-authored-by: rahulramesha --- apiserver/plane/app/views/workspace.py | 3 --- web/store/member/workspace-member.store.ts | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/apiserver/plane/app/views/workspace.py b/apiserver/plane/app/views/workspace.py index 3c9bc8b60..6677b4c4b 100644 --- a/apiserver/plane/app/views/workspace.py +++ b/apiserver/plane/app/views/workspace.py @@ -560,7 +560,6 @@ class WorkSpaceMemberViewSet(BaseViewSet): .get_queryset() .filter( workspace__slug=self.kwargs.get("slug"), - member__is_bot=False, is_active=True, ) .select_related("workspace", "workspace__owner") @@ -768,7 +767,6 @@ class WorkspaceProjectMemberEndpoint(BaseAPIView): project_ids = ( ProjectMember.objects.filter( member=request.user, - member__is_bot=False, is_active=True, ) .values_list("project_id", flat=True) @@ -778,7 +776,6 @@ class WorkspaceProjectMemberEndpoint(BaseAPIView): # Get all the project members in which the user is involved project_members = ProjectMember.objects.filter( workspace__slug=slug, - member__is_bot=False, project_id__in=project_ids, is_active=True, ).select_related("project", "member", "workspace") diff --git a/web/store/member/workspace-member.store.ts b/web/store/member/workspace-member.store.ts index 1dae25bd4..4a696bfd2 100644 --- a/web/store/member/workspace-member.store.ts +++ b/web/store/member/workspace-member.store.ts @@ -98,7 +98,8 @@ export class WorkspaceMemberStore implements IWorkspaceMemberStore { (m) => m.member !== this.userStore.currentUser?.id, (m) => this.memberRoot?.memberMap?.[m.member]?.display_name?.toLowerCase(), ]); - const memberIds = members.map((m) => m.member); + //filter out bots + const memberIds = members.filter((m) => !this.memberRoot?.memberMap?.[m.member]?.is_bot).map((m) => m.member); return memberIds; }