Skip to content

Commit

Permalink
Bugfix: avoid error upon getting succesfully cancelled order
Browse files Browse the repository at this point in the history
  • Loading branch information
femelo committed Nov 11, 2024
1 parent 054093d commit 52b2860
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ def get(self, request, format=None):
# 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
Expand Down

0 comments on commit 52b2860

Please sign in to comment.