From 6ce722399c4a4fac4f8fd48edaba14b6a561b09c Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sat, 23 Apr 2022 19:52:42 +0100 Subject: [PATCH] Don't double count Nordigen accounts --- handler/sinks/nordigen.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/handler/sinks/nordigen.py b/handler/sinks/nordigen.py index 6ddb1f8..38c14f2 100644 --- a/handler/sinks/nordigen.py +++ b/handler/sinks/nordigen.py @@ -309,15 +309,11 @@ 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: @@ -395,6 +391,8 @@ class Nordigen(util.Base): if not currency == entry["balanceAmount"]["currency"]: self.log.error("Different currencies in balance query.") return + if not entry["balanceType"] == "interimBooked": + continue total += float(entry["balanceAmount"]["amount"]) currency = entry["balanceAmount"]["currency"] return (currency, total)