From ca919d2d5c0430c3e3e24a84723b64ff2a397892 Mon Sep 17 00:00:00 2001 From: alireza Date: Mon, 7 Apr 2025 18:52:12 +0330 Subject: [PATCH] fix delete --- apps/transaction/views.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/transaction/views.py b/apps/transaction/views.py index ec53557..5502545 100644 --- a/apps/transaction/views.py +++ b/apps/transaction/views.py @@ -114,7 +114,10 @@ class SoftDeleteTransactionParticipantView(APIView): "message": "Transaction participant successfully marked as deleted" }, status=status.HTTP_200_OK) else: - return AppAPIException({'message': "You don't have permission to delete this transaction"}, status_code=status.HTTP_403_FORBIDDEN) - + raise AppAPIException( + detail={'message': "You don't have permission to delete this transaction"}, + status_code=status.HTTP_403_FORBIDDEN + ) + except TransactionParticipant.DoesNotExist: return AppAPIException({'message': "Transaction participant not found"})