From 3a599b64360555c3c2ab35a7e8808c99a66cd13b Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Thu, 30 Mar 2023 16:32:48 +0530 Subject: [PATCH] chore: workspace detail on issue activity serializer (#607) --- apiserver/plane/api/serializers/issue.py | 1 + apiserver/plane/api/views/issue.py | 2 +- apiserver/plane/api/views/people.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apiserver/plane/api/serializers/issue.py b/apiserver/plane/api/serializers/issue.py index b8f86cdcf..81db447f0 100644 --- a/apiserver/plane/api/serializers/issue.py +++ b/apiserver/plane/api/serializers/issue.py @@ -244,6 +244,7 @@ class IssueCreateSerializer(BaseSerializer): class IssueActivitySerializer(BaseSerializer): actor_detail = UserLiteSerializer(read_only=True, source="actor") + workspace_detail = WorkspaceLiteSerializer(read_only=True, source="workspace") class Meta: model = IssueActivity diff --git a/apiserver/plane/api/views/issue.py b/apiserver/plane/api/views/issue.py index d0786c8f1..d22c65092 100644 --- a/apiserver/plane/api/views/issue.py +++ b/apiserver/plane/api/views/issue.py @@ -285,7 +285,7 @@ class IssueActivityEndpoint(BaseAPIView): ~Q(field="comment"), project__project_projectmember__member=self.request.user, ) - .select_related("actor") + .select_related("actor", "workspace") ).order_by("created_at") issue_comments = ( IssueComment.objects.filter(issue_id=issue_id) diff --git a/apiserver/plane/api/views/people.py b/apiserver/plane/api/views/people.py index d08eeaa71..cafda3efd 100644 --- a/apiserver/plane/api/views/people.py +++ b/apiserver/plane/api/views/people.py @@ -87,7 +87,7 @@ class UserActivityEndpoint(BaseAPIView, BasePaginator): def get(self, request): try: queryset = IssueActivity.objects.filter(actor=request.user).select_related( - "actor" + "actor", "workspace" ) return self.paginate(