Fix off by one issue in OANDA
This commit is contained in:
@@ -39,6 +39,9 @@ class TradeAction(LoginRequiredMixin, OTPRequiredMixin, View):
|
||||
return HttpResponseBadRequest("Trade not found.")
|
||||
if db_info.order_id is not None:
|
||||
try:
|
||||
if db_info.order_id == db_info.response["id"]:
|
||||
db_info.order_id = str(int(db_info.order_id) + 1)
|
||||
db_info.save()
|
||||
live_info = db_info.account.client.get_trade(db_info.order_id)
|
||||
except GenericAPIError as e:
|
||||
live_info = {"error": e}
|
||||
|
||||
Reference in New Issue
Block a user