From 004d6d049e6f15d68ed6d5cde98626a2c4553588 Mon Sep 17 00:00:00 2001 From: Remi - Le Filament <30716308+remi-filament@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:49:25 +0200 Subject: [PATCH] [FIX] handle string notifications as warnings --- account_ebics/__manifest__.py | 2 +- account_ebics/models/ebics_file.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/account_ebics/__manifest__.py b/account_ebics/__manifest__.py index 3daa03c..5b9b51a 100644 --- a/account_ebics/__manifest__.py +++ b/account_ebics/__manifest__.py @@ -3,7 +3,7 @@ { "name": "EBICS banking protocol", - "version": "17.0.1.1.1", + "version": "17.0.1.1.2", "license": "LGPL-3", "author": "Noviat", "website": "https://www.noviat.com", diff --git a/account_ebics/models/ebics_file.py b/account_ebics/models/ebics_file.py index 29a3370..66f2af8 100644 --- a/account_ebics/models/ebics_file.py +++ b/account_ebics/models/ebics_file.py @@ -253,14 +253,17 @@ class EbicsFile(models.Model): errors = [] warnings = [] for notif in notifications: - if notif["type"] == "error": + if isinstance(notif, dict) and notif["type"] == "error": error_cnt += 1 parts = [notif[k] for k in notif if k in ("message", "details")] errors.append("\n".join(parts)) - elif notif["type"] == "warning": + elif isinstance(notif, dict) and notif["type"] == "warning": warning_cnt += 1 parts = [notif[k] for k in notif if k in ("message", "details")] warnings.append("\n".join(parts)) + elif isinstance(notif, str): + warning_cnt += 1 + warnings.append(notif + "\n") self.note_process += _("Process file %(fn)s results:", fn=self.name) if error_cnt: