Commit 241a12b5 authored by Célande Adrien's avatar Célande Adrien Committed by Vincent A

[creditmutuel] card for adding recipients must be activated

After receiving its `Carte de Clés Personnelles`, the user must activate
it.

Closes: 32492@sibi
parent c3228586
......@@ -630,6 +630,9 @@ class CreditMutuelBrowser(LoginBrowser, StatesMixin):
def continue_new_recipient(self, recipient, **params):
if 'Clé' in params:
self.page.post_code(params['Clé'])
if self.verify_pass.is_here():
self.page.handle_error()
assert False, 'An error occured while checking the card code'
self.page.add_recipient(recipient)
if self.page.bic_needed():
self.page.ask_bic(self.get_recipient_object(recipient))
......
......@@ -1772,6 +1772,12 @@ class VerifCodePage(LoggedPage, HTMLPage):
form['valChx.y'] = '1'
form.submit()
def handle_error(self):
error_msg = CleanText('//div[@class="blocmsg info"]/p')(self.doc)
# the card was not activated yet
if 'veuillez activer votre carte' in error_msg:
raise AddRecipientBankError(message=error_msg)
class RecipientsListPage(LoggedPage, HTMLPage):
def on_load(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