From 52b28606995f631ebddffb3d32b2e9cac6267a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Eler=20De=20Melo?= Date: Mon, 11 Nov 2024 14:52:38 +0100 Subject: [PATCH] Bugfix: avoid error upon getting succesfully cancelled order --- api/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/views.py b/api/views.py index a03dbd33..23056b14 100644 --- a/api/views.py +++ b/api/views.py @@ -225,13 +225,13 @@ class OrderView(viewsets.ViewSet): # 2) If order has been cancelled if order.status == Order.Status.UCA: return Response( - {"bad_request": "This order has been cancelled by the maker"}, - status.HTTP_400_BAD_REQUEST, + {"status": "This order has been cancelled by the maker"}, + status.HTTP_204_NO_CONTENT, ) if order.status == Order.Status.CCA: return Response( - {"bad_request": "This order has been cancelled collaborativelly"}, - status.HTTP_400_BAD_REQUEST, + {"status": "This order has been cancelled collaborativelly"}, + status.HTTP_204_NO_CONTENT, ) data = ListOrderSerializer(order).data