Commit ca6950df authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[caissedepargne] better regexp for transfer to external recipient

in case of external recipient label is like :

XX - XXXXX XXXXX - FRXXXXXXXXXXXXXXXXXXXXXXXXXXX -
XX - XXXXXXX - FRXXXXXXXXXXXXXXXXXXXXXXXXXXX -
 - FRXXXXXXXXXXXXXXXXXXXXXXXXXXX -
parent 6b1cacf4
......@@ -996,7 +996,7 @@ class TransferPage(TransferErrorPage, IndexPage):
def get_recipient_value(self, recipient):
if recipient.category == u'Externe':
recipient_value = [Attr('.', 'value')(o) for o in self.doc.xpath(self.RECIPIENT_XPATH) if
Regexp(CleanText('.'), ' - (.*) -', default=NotAvailable)(o) == recipient.iban]
Regexp(CleanText('.'), '.* - ([A-Za-z0-9]*) -', default=NotAvailable)(o) == recipient.iban]
elif recipient.category == u'Interne':
recipient_value = [Attr('.', 'value')(o) for o in self.doc.xpath(self.RECIPIENT_XPATH) if
Regexp(CleanText('.'), '- (\d+)', default=NotAvailable)(o) and Regexp(CleanText('.'), '- (\d+)', default=NotAvailable)(o) in recipient.id]
......
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