From c1273532812feca3e4f9611da2074d29584ad4e2 Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Tue, 6 Jun 2023 19:15:56 +0530 Subject: [PATCH] chore: workspace invite created detail (#1209) * chore: workspace invite created detail * dev: select related workspace member invite list --- apiserver/plane/api/serializers/workspace.py | 1 + apiserver/plane/api/views/workspace.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apiserver/plane/api/serializers/workspace.py b/apiserver/plane/api/serializers/workspace.py index 4562726ae..078a4bf08 100644 --- a/apiserver/plane/api/serializers/workspace.py +++ b/apiserver/plane/api/serializers/workspace.py @@ -45,6 +45,7 @@ class WorkSpaceMemberSerializer(BaseSerializer): class WorkSpaceMemberInviteSerializer(BaseSerializer): workspace = WorkSpaceSerializer(read_only=True) total_members = serializers.IntegerField(read_only=True) + created_by_detail = UserLiteSerializer(read_only=True, source="created_by") class Meta: model = WorkspaceMemberInvite diff --git a/apiserver/plane/api/views/workspace.py b/apiserver/plane/api/views/workspace.py index e8e7160f4..58249d9b6 100644 --- a/apiserver/plane/api/views/workspace.py +++ b/apiserver/plane/api/views/workspace.py @@ -361,7 +361,7 @@ class WorkspaceInvitationsViewset(BaseViewSet): super() .get_queryset() .filter(workspace__slug=self.kwargs.get("slug")) - .select_related("workspace", "workspace__owner") + .select_related("workspace", "workspace__owner", "created_by") ) @@ -374,7 +374,7 @@ class UserWorkspaceInvitationsEndpoint(BaseViewSet): super() .get_queryset() .filter(email=self.request.user.email) - .select_related("workspace", "workspace__owner") + .select_related("workspace", "workspace__owner", "created_by") .annotate(total_members=Count("workspace__workspace_member")) )