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): class IssueActivitySerializer(BaseSerializer):
actor_detail = UserLiteSerializer(read_only=True, source="actor") actor_detail = UserLiteSerializer(read_only=True, source="actor")
workspace_detail = WorkspaceLiteSerializer(read_only=True, source="workspace")
class Meta: class Meta:
model = IssueActivity model = IssueActivity

View File

@ -285,7 +285,7 @@ class IssueActivityEndpoint(BaseAPIView):
~Q(field="comment"), ~Q(field="comment"),
project__project_projectmember__member=self.request.user, project__project_projectmember__member=self.request.user,
) )
.select_related("actor") .select_related("actor", "workspace")
).order_by("created_at") ).order_by("created_at")
issue_comments = ( issue_comments = (
IssueComment.objects.filter(issue_id=issue_id) IssueComment.objects.filter(issue_id=issue_id)

View File

@ -87,7 +87,7 @@ class UserActivityEndpoint(BaseAPIView, BasePaginator):
def get(self, request): def get(self, request):
try: try:
queryset = IssueActivity.objects.filter(actor=request.user).select_related( queryset = IssueActivity.objects.filter(actor=request.user).select_related(
"actor" "actor", "workspace"
) )
return self.paginate( return self.paginate(