From 2e02cdba9e2976c229eaf8dcb09054b520cc7afb Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sun, 12 Mar 2023 13:10:37 +0000 Subject: [PATCH] Fix adding time to transactions when usual fields absent --- core/clients/aggregators/nordigen.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/clients/aggregators/nordigen.py b/core/clients/aggregators/nordigen.py index 296eb59..03077fe 100644 --- a/core/clients/aggregators/nordigen.py +++ b/core/clients/aggregators/nordigen.py @@ -265,12 +265,15 @@ class NordigenClient(BaseClient, AggregatorClient): # Rename timestamp - if "bookingDateTime" in transaction: + if transaction["bookingDateTime"]: transaction["ts"] = transaction["bookingDateTime"] del transaction["bookingDateTime"] - elif "bookingDate" in transaction: + elif transaction["bookingDate"]: transaction["ts"] = transaction["bookingDate"] del transaction["bookingDate"] + elif transaction["valueDate"]: + transaction["ts"] = transaction["valueDate"] + del transaction["valueDate"] transaction["amount"] = float(transaction["transactionAmount"]["amount"]) transaction["currency"] = transaction["transactionAmount"]["currency"]