chore: workspace detail on issue activity serializer (#607)

This commit is contained in:
pablohashescobar 2023-03-30 16:32:48 +05:30 committed by GitHub
parent c5ccc29418
commit 3a599b6436
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

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

View File

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

View File

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