Fix small bug when cancel-order does not contain id

happens with kraken ...
This commit is contained in:
Matthias 2020-10-20 06:24:46 +02:00
parent f6da9e358a
commit 2d04c2dd4f

View File

@ -167,12 +167,12 @@ class Order(_DECL_BASE):
""" """
Get all non-closed orders - useful when trying to batch-update orders Get all non-closed orders - useful when trying to batch-update orders
""" """
filtered_orders = [o for o in orders if o.order_id == order['id']] filtered_orders = [o for o in orders if o.order_id == order.get('id')]
if filtered_orders: if filtered_orders:
oobj = filtered_orders[0] oobj = filtered_orders[0]
oobj.update_from_ccxt_object(order) oobj.update_from_ccxt_object(order)
else: else:
logger.warning(f"Did not find order for {order['id']}.") logger.warning(f"Did not find order for {order}.")
@staticmethod @staticmethod
def parse_from_ccxt_object(order: Dict[str, Any], pair: str, side: str) -> 'Order': def parse_from_ccxt_object(order: Dict[str, Any], pair: str, side: str) -> 'Order':