From b14d040eaa75a55731ef650e76425d7d356ec2b9 Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Thu, 18 Jul 2024 22:50:49 +0000 Subject: [PATCH] fix(truelayer): Skip unsupported account types Some providers (e.g. barclaycard) do not support both "accounts" and "cards". If the truelayer importer comes across such a provider, it will fail to fetch the unsupported account type, and omit that from the config If the key is omitted from the config, we'll try to read from an invalid key when we later look for all transactions --- autobean/truelayer/importer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autobean/truelayer/importer.py b/autobean/truelayer/importer.py index 97a651a..da5a91d 100644 --- a/autobean/truelayer/importer.py +++ b/autobean/truelayer/importer.py @@ -183,6 +183,9 @@ def _fetch_balances( def _fetch_all_transactions(self) -> list[Directive]: entries: list[Directive] = [] for type_ in ACCOUNT_TYPES: + if not type_ in self._config.data: + continue + for account_id, account in self._config.data[type_].items(): if not account['enabled']: continue