mirror of
https://github.com/RoboSats/robosats.git
synced 2025-09-13 00:56:22 +00:00
Better view info
This commit is contained in:
11
api/views.py
11
api/views.py
@ -244,14 +244,9 @@ class OrderView(viewsets.ViewSet):
|
|||||||
data["has_password"] = order.password is not None
|
data["has_password"] = order.password is not None
|
||||||
|
|
||||||
# 2) If order has been cancelled
|
# 2) If order has been cancelled
|
||||||
if order.status == Order.Status.UCA:
|
if order.status == Order.Status.UCA or order.status == Order.Status.CCA:
|
||||||
return Response(
|
return Response(
|
||||||
{"bad_request": "This order has been cancelled by the maker"},
|
{"bad_request": "This order has been cancelled"},
|
||||||
status.HTTP_400_BAD_REQUEST,
|
|
||||||
)
|
|
||||||
if order.status == Order.Status.CCA:
|
|
||||||
return Response(
|
|
||||||
{"bad_request": "This order has been cancelled collaborativelly"},
|
|
||||||
status.HTTP_400_BAD_REQUEST,
|
status.HTTP_400_BAD_REQUEST,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -262,7 +257,7 @@ class OrderView(viewsets.ViewSet):
|
|||||||
if is_penalized:
|
if is_penalized:
|
||||||
data["penalty"] = request.user.robot.penalty_expiration
|
data["penalty"] = request.user.robot.penalty_expiration
|
||||||
|
|
||||||
# 1) If order has a password
|
# 2.1) If order has a password
|
||||||
if not data["is_participant"] and order.password is not None:
|
if not data["is_participant"] and order.password is not None:
|
||||||
return Response(data, status.HTTP_200_OK)
|
return Response(data, status.HTTP_200_OK)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user