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"})