Commit 6890cbdc authored by Célande Adrien's avatar Célande Adrien Committed by Romain Bignon

[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
parent 88e5599e
......@@ -207,12 +207,13 @@ class AccountList(LoggedPage, MyHTMLPage):
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment