From c136b1b4c8685d3651c4b01eba0210d055cdefdd Mon Sep 17 00:00:00 2001 From: Guillaume Risbourg Date: Wed, 18 Dec 2019 14:38:46 +0100 Subject: [PATCH] [creditmutuel] Handle transactions with no label --- modules/creditmutuel/pages.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/creditmutuel/pages.py b/modules/creditmutuel/pages.py index 90454f3b0d..30762185a5 100644 --- a/modules/creditmutuel/pages.py +++ b/modules/creditmutuel/pages.py @@ -802,6 +802,11 @@ def __call__(self, item): for txt in el.itertext() if txt.strip()) # Removing empty strings parts = list(filter(bool, parts)) + + # Some transactions have no label + if not parts: + return NotAvailable + # To simplify categorization of CB, reverse order of parts to separate # location and institution detail = "Cliquer pour déplier ou plier le détail de l'opération" @@ -812,7 +817,11 @@ def __call__(self, item): return ' '.join(parts) - obj_raw = Transaction.Raw(OwnRaw()) + def obj_raw(self): + own_raw = self.OwnRaw()(self) + if empty(own_raw): + return NotAvailable + return Transaction.Raw(self.OwnRaw())(self) def find_amount(self, title): try: -- GitLab