From 6890cbdc2958d801556cf320d1419320a6f2bd85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9lande=20Adrien?= Date: Fri, 20 Jul 2018 16:35:34 +0200 Subject: [PATCH] [bp] invalid account id At first the account id was taken from an option tag. But this id was used to look for accounts that begin with this id. Now it looks for the id in the account table. This case conflicts with 1 table student loan which needs the id in the option tag. Changing the order of the ifs is enough. Closes: 15258@sibi Closes: 15334@sibi Closes: 15335@sibi Closes: 6592@zendesk Closes: 6334@zendesk --- modules/bp/pages/accountlist.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/bp/pages/accountlist.py b/modules/bp/pages/accountlist.py index 720fd861da..e683b9a330 100644 --- a/modules/bp/pages/accountlist.py +++ b/modules/bp/pages/accountlist.py @@ -207,12 +207,13 @@ def load_details(self): obj_total_amount = CleanDecimal(TableCell('total_amount'), replace_dots=True, default=NotAvailable) def obj_id(self): + if TableCell('label', default=None)(self): + return Regexp(CleanText(Field('label'), default=NotAvailable), '- (\w{16})')(self) + # student_loan if CleanText('//select[@id="numOffrePretSelection"]/option[@selected="selected"]')(self): return Regexp(CleanText('//select[@id="numOffrePretSelection"]/option[@selected="selected"]'), r'(\d+)')(self) - if TableCell('label', default=None)(self): - return Regexp(CleanText(Field('label'), default=NotAvailable), '- (\w{16})')(self) return CleanText('//form[contains(@action, "detaillerOffre") or contains(@action, "detaillerPretPartenaireListe-encoursPrets.ea")]/div[@class="bloc Tmargin"]/div[@class="formline"][2]/span/strong')(self) obj_type = Account.TYPE_LOAN -- GitLab