Skip to content

Commit 1310df2

Browse files
committed
transaction fix
1 parent 59c95be commit 1310df2

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

td/client.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,9 +1871,26 @@ def modify_order(self, account: str, order: dict, order_id: str) -> dict:
18711871
----
18721872
{dict} -- A response dicitonary.
18731873
"""
1874+
1875+
# Check if it's an order.
1876+
if isinstance(order, Order):
1877+
order = order._grab_order()
1878+
else:
1879+
order = order
1880+
18741881
# make the request
1875-
endpoint = 'accounts/{account_id}/orders/{order_id}'.format(account_id=account, order_id=order_id)
1876-
return self._make_request(method='put', endpoint=endpoint, mode='json', json=order, order_details=True)
1882+
endpoint = 'accounts/{account_id}/orders/{order_id}'.format(
1883+
account_id=account,
1884+
order_id=order_id
1885+
)
1886+
1887+
return self._make_request(
1888+
method='put',
1889+
endpoint=endpoint,
1890+
mode='json',
1891+
json=order,
1892+
order_details=True
1893+
)
18771894

18781895
def get_saved_order(self, account: str, saved_order_id: str = None) -> Dict:
18791896
"""Grabs a saved order.

0 commit comments

Comments
 (0)