Set cancel_status if it's not None

This commit is contained in:
aftermath2 2024-07-07 10:40:57 -03:00
parent 99ecf54b18
commit ec0356f1b6
No known key found for this signature in database
GPG Key ID: FD0F36BBFF2D928C

View File

@ -116,7 +116,9 @@ class Trade:
path = reverse("order")
params = f"?order_id={self.order_id}"
headers = self.get_robot_auth(robot_index)
body = {"action": "cancel", "cancel_status": cancel_status}
body = {"action": "cancel"}
if cancel_status is not None:
body.update({"cancel_status": cancel_status})
self.response = self.client.post(path + params, body, **headers)
@patch("api.tasks.send_notification.delay", send_notification)