From e1812b0152795d684cb13c04e6c5dd28887ae045 Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Tue, 13 Nov 2018 12:07:25 +0100 Subject: [PATCH] [hsbc] Added default account name when label is empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some accounts have a balance but no label on the website. To avoid empty account labels I added "Compte sans libellé" as a default value. --- modules/hsbc/pages/account_pages.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/hsbc/pages/account_pages.py b/modules/hsbc/pages/account_pages.py index f129080835..e72d8544ea 100644 --- a/modules/hsbc/pages/account_pages.py +++ b/modules/hsbc/pages/account_pages.py @@ -158,7 +158,9 @@ class item(ItemElement): def condition(self): return len(self.el.xpath('./td')) > 2 - obj_label = Label(CleanText('./td[1]/a')) + def obj_label(self): + return Label(CleanText('./td[1]/a'))(self) or 'Compte sans libellé' + obj_coming = Env('coming') obj_currency = FrenchTransaction.Currency('./td[2]') -- GitLab