From 537a82028e85aac064d812b57227653001ddbfae Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Thu, 13 Apr 2023 00:33:50 +0530 Subject: [PATCH] fix: attachment activity (#760) --- apiserver/plane/api/views/issue.py | 4 ++-- apiserver/plane/bgtasks/issue_activites_task.py | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apiserver/plane/api/views/issue.py b/apiserver/plane/api/views/issue.py index c7910b23e..963115c96 100644 --- a/apiserver/plane/api/views/issue.py +++ b/apiserver/plane/api/views/issue.py @@ -751,7 +751,7 @@ class IssueAttachmentEndpoint(BaseAPIView): serializer.save(project_id=project_id, issue_id=issue_id) issue_activity.delay( type="attachment.activity.created", - requested_data=request.data, + requested_data=None, actor_id=str(self.request.user.id), issue_id=str(self.kwargs.get("issue_id", None)), project_id=str(self.kwargs.get("project_id", None)), @@ -776,7 +776,7 @@ class IssueAttachmentEndpoint(BaseAPIView): issue_attachment.delete() issue_activity.delay( type="attachment.activity.deleted", - requested_data=request.data, + requested_data=None, actor_id=str(self.request.user.id), issue_id=str(self.kwargs.get("issue_id", None)), project_id=str(self.kwargs.get("project_id", None)), diff --git a/apiserver/plane/bgtasks/issue_activites_task.py b/apiserver/plane/bgtasks/issue_activites_task.py index 192f5170b..59cc4aae1 100644 --- a/apiserver/plane/bgtasks/issue_activites_task.py +++ b/apiserver/plane/bgtasks/issue_activites_task.py @@ -833,13 +833,12 @@ def create_attachment_activity( issue_id=issue_id, project=project, workspace=project.workspace, - comment=f"{actor.email} created a attachment", + comment=f"{actor.email} created an attachment", verb="created", actor=actor, field="attachment", - new_value=requested_data.get("url", ""), - new_identifier=requested_data.get("id", None), - issue_comment_id=requested_data.get("id", None), + new_value=current_instance.get("access", ""), + new_identifier=current_instance.get("id", None), ) )