fixed accepted order status

parent 89a451b5
...@@ -49,6 +49,9 @@ class OrderService: ...@@ -49,6 +49,9 @@ class OrderService:
except common_exc.NotFoundException as e: except common_exc.NotFoundException as e:
raise http_exc.HTTPBadRequestException(detail=str(e)) raise http_exc.HTTPBadRequestException(detail=str(e))
if order.status != Order.StatusEnum.IN_PROCESSING:
raise http_exc.HTTPBadRequestException(detail='Order must be in IN PROCESSING status to be completed')
order.status = Order.StatusEnum.CONFIRMED order.status = Order.StatusEnum.CONFIRMED
await order.save() await order.save()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment