From 32af22cff4f2cc53f975696ac3d4b1c3859bfdc1 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sat, 23 Apr 2022 19:39:09 +0100 Subject: [PATCH] Fix releasing mapped trades --- handler/sinks/nordigen.py | 4 ++++ handler/transactions.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/handler/sinks/nordigen.py b/handler/sinks/nordigen.py index 74254a8..6ddb1f8 100644 --- a/handler/sinks/nordigen.py +++ b/handler/sinks/nordigen.py @@ -309,11 +309,15 @@ class Nordigen(util.Base): self.log.error("Could not get requisitions.") return {} for req in requisitions: + print("REQ ITER", req) if not req["accounts"]: + print("NOT REQ ACCOUNTS") continue accounts = self.get_accounts(req["id"]) for account_id in accounts: + print("ACCOUNT ID ITER", account_id) account_info = self.get_account(account_id) + print("INFO", account_info) if not account_info: continue if req["institution_id"] in to_return: diff --git a/handler/transactions.py b/handler/transactions.py index 9b067c8..00872f2 100644 --- a/handler/transactions.py +++ b/handler/transactions.py @@ -295,9 +295,10 @@ class Transactions(util.Base): Return False if the trade already has a mapped transaction. """ existing_tx = r.hget(f"trade.{reference}", "tx") + print("existing_tx", existing_tx) if existing_tx is None: return None - elif existing_tx == "": + elif existing_tx == b"": r.hset(f"trade.{reference}", "tx", txid) return True else: # Already a mapped transaction