|
@@ -55,7 +55,7 @@ def notify_expired_orders(orders):
|
|
ownership_id = order[1]
|
|
ownership_id = order[1]
|
|
|
|
|
|
# check if that was one of the bots orders
|
|
# check if that was one of the bots orders
|
|
- bank_ownership_id = model.get_ownership_id(ownership_id, model.bank_id())
|
|
|
|
|
|
+ bank_ownership_id = model.get_ownership_id(model.ownable_id_by_ownership_id(ownership_id), model.bank_id())
|
|
if ownership_id != bank_ownership_id:
|
|
if ownership_id != bank_ownership_id:
|
|
continue
|
|
continue
|
|
|
|
|
|
@@ -110,7 +110,7 @@ def notify_order_traded(ownable_id):
|
|
dt_order_placed = datetime.strptime(expiry, '%Y-%m-%d %H:%M:%S') - timedelta(minutes=DEFAULT_ORDER_EXPIRY)
|
|
dt_order_placed = datetime.strptime(expiry, '%Y-%m-%d %H:%M:%S') - timedelta(minutes=DEFAULT_ORDER_EXPIRY)
|
|
|
|
|
|
model.cursor.execute('''
|
|
model.cursor.execute('''
|
|
- SELECT SUM(amount) >= 2 * ?
|
|
|
|
|
|
+ SELECT COALESCE(SUM(amount), 0) >= 2 * ?
|
|
FROM transactions
|
|
FROM transactions
|
|
WHERE ownable_id = ?
|
|
WHERE ownable_id = ?
|
|
AND dt > ? -- interestingly >= would be problematic
|
|
AND dt > ? -- interestingly >= would be problematic
|