From b4d11783632e3c28df86642e5f848340e949fc4c Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Thu, 28 Sep 2023 12:35:41 +0530 Subject: [PATCH] fix: inbox issue deletes --- apiserver/plane/api/views/inbox.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apiserver/plane/api/views/inbox.py b/apiserver/plane/api/views/inbox.py index 79294275e31..4bfc32f0198 100644 --- a/apiserver/plane/api/views/inbox.py +++ b/apiserver/plane/api/views/inbox.py @@ -370,6 +370,11 @@ def destroy(self, request, slug, project_id, inbox_id, pk): if project_member.role <= 10 and str(inbox_issue.created_by_id) != str(request.user.id): return Response({"error": "You cannot delete inbox issue"}, status=status.HTTP_400_BAD_REQUEST) + # Check the issue status + if inbox_issue.status in [-2, -1, 0, 2]: + # Delete the issue also + Issue.objects.filter(workspace__slug=slug, project_id=project_id, pk=inbox_issue.issue_id).delete() + inbox_issue.delete() return Response(status=status.HTTP_204_NO_CONTENT) except InboxIssue.DoesNotExist: