Fix adding time to transactions when usual fields absent
This commit is contained in:
parent
b800139bcf
commit
2e02cdba9e
|
@ -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"]
|
||||
|
|
Loading…
Reference in New Issue