forked from github/plane
chore: issue and project details in activity (#1747)
* chore: issue and project details in activity * dev: update capture log
This commit is contained in:
parent
a66a0680df
commit
e73a4bef4e
@ -291,7 +291,8 @@ 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")
|
issue_detail = IssueFlatSerializer(read_only=True, source="issue")
|
||||||
|
project_detail = ProjectLiteSerializer(read_only=True, source="project")
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = IssueActivity
|
model = IssueActivity
|
||||||
|
@ -477,7 +477,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", "workspace")
|
.select_related("actor", "workspace", "issue", "project")
|
||||||
).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)
|
||||||
|
@ -140,7 +140,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", "workspace"
|
"actor", "workspace", "issue", "project"
|
||||||
)
|
)
|
||||||
|
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
|
@ -267,7 +267,7 @@ class ProjectViewSet(BaseViewSet):
|
|||||||
status=status.HTTP_410_GONE,
|
status=status.HTTP_410_GONE,
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pr(e)
|
capture_exception(e)
|
||||||
return Response(
|
return Response(
|
||||||
{"error": "Something went wrong please try again later"},
|
{"error": "Something went wrong please try again later"},
|
||||||
status=status.HTTP_400_BAD_REQUEST,
|
status=status.HTTP_400_BAD_REQUEST,
|
||||||
|
@ -1190,7 +1190,7 @@ class WorkspaceUserActivityEndpoint(BaseAPIView):
|
|||||||
workspace__slug=slug,
|
workspace__slug=slug,
|
||||||
project__project_projectmember__member=request.user,
|
project__project_projectmember__member=request.user,
|
||||||
actor=user_id,
|
actor=user_id,
|
||||||
).select_related("actor", "workspace")
|
).select_related("actor", "workspace", "issue", "project")
|
||||||
|
|
||||||
if projects:
|
if projects:
|
||||||
queryset = queryset.filter(project__in=projects)
|
queryset = queryset.filter(project__in=projects)
|
||||||
|
Loading…
Reference in New Issue
Block a user