fix: attachment activity (#760)

This commit is contained in:
pablohashescobar 2023-04-13 00:33:50 +05:30 committed by GitHub
parent 440ed08728
commit 537a82028e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -751,7 +751,7 @@ class IssueAttachmentEndpoint(BaseAPIView):
serializer.save(project_id=project_id, issue_id=issue_id) serializer.save(project_id=project_id, issue_id=issue_id)
issue_activity.delay( issue_activity.delay(
type="attachment.activity.created", type="attachment.activity.created",
requested_data=request.data, requested_data=None,
actor_id=str(self.request.user.id), actor_id=str(self.request.user.id),
issue_id=str(self.kwargs.get("issue_id", None)), issue_id=str(self.kwargs.get("issue_id", None)),
project_id=str(self.kwargs.get("project_id", None)), project_id=str(self.kwargs.get("project_id", None)),
@ -776,7 +776,7 @@ class IssueAttachmentEndpoint(BaseAPIView):
issue_attachment.delete() issue_attachment.delete()
issue_activity.delay( issue_activity.delay(
type="attachment.activity.deleted", type="attachment.activity.deleted",
requested_data=request.data, requested_data=None,
actor_id=str(self.request.user.id), actor_id=str(self.request.user.id),
issue_id=str(self.kwargs.get("issue_id", None)), issue_id=str(self.kwargs.get("issue_id", None)),
project_id=str(self.kwargs.get("project_id", None)), project_id=str(self.kwargs.get("project_id", None)),

View File

@ -833,13 +833,12 @@ def create_attachment_activity(
issue_id=issue_id, issue_id=issue_id,
project=project, project=project,
workspace=project.workspace, workspace=project.workspace,
comment=f"{actor.email} created a attachment", comment=f"{actor.email} created an attachment",
verb="created", verb="created",
actor=actor, actor=actor,
field="attachment", field="attachment",
new_value=requested_data.get("url", ""), new_value=current_instance.get("access", ""),
new_identifier=requested_data.get("id", None), new_identifier=current_instance.get("id", None),
issue_comment_id=requested_data.get("id", None),
) )
) )