Commit bbef05ce authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by Romain Bignon

[creditdunord] Corrected ISIN research in Label

Some ISIN codes are written as "fr56168431698" so we must consider small
letters too. Plus the current code caught "TECHNOLOGIES" as a potential
ISIN. The new code takes in consideration these matters.
parent 1a75c09f
......@@ -670,9 +670,10 @@ class TransactionsPage(LoggedPage, CDNBasePage):
obj_portfolio_share = Eval(lambda x: x / 100, MyDecimal(TableCell('portfolio_share')))
def obj_code(self):
code = Regexp(Field('label'), '([0-9A-Z]{12})')(self)
if is_isin_valid(code):
return code
for code in Field('label')(self).split():
if is_isin_valid(code):
return code
return NotAvailable
def obj_code_type(self):
if is_isin_valid(Field('code')(self)):
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