Skip to content

Commit

Permalink
fixup! fixup! [IMP] account_statement_import_camt: multi account support
Browse files Browse the repository at this point in the history
fix zip file import
  • Loading branch information
gurneyalex committed Feb 6, 2024
1 parent c498cfc commit 6d62744
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions account_statement_import_camt/models/account_statement_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ def _parse_file(self, data_file):
except ValueError:
try:
with zipfile.ZipFile(BytesIO(data_file)) as data:
currency = None
account_number = None
transactions = []
result = []
for member in data.namelist():
currency, account_number, new = self._parse_file(
data.open(member).read()
)
transactions.extend(new)
return currency, account_number, transactions
res = self._parse_file(data.open(member).read())
if isinstance(res, tuple):
res = [res]

Check warning on line 28 in account_statement_import_camt/models/account_statement_import.py

View check run for this annotation

Codecov / codecov/patch

account_statement_import_camt/models/account_statement_import.py#L28

Added line #L28 was not covered by tests
result += res
return result
# pylint: disable=except-pass
except (zipfile.BadZipFile, ValueError):
pass
Expand Down

0 comments on commit 6d62744

Please sign in to comment.