Commit 8be4a4ab authored by Romain Bignon's avatar Romain Bignon Committed by Vincent A

boobank: support DecoupledValidation during add_recipient

parent 5560adb8
......@@ -28,7 +28,7 @@ from decimal import Decimal, InvalidOperation
from weboob.browser.browsers import APIBrowser
from weboob.browser.profiles import Weboob
from weboob.exceptions import BrowserHTTPError, CaptchaQuestion
from weboob.exceptions import BrowserHTTPError, CaptchaQuestion, DecoupledValidation
from weboob.core.bcall import CallErrors
from weboob.capabilities.base import empty, find_object
from weboob.capabilities.bank import (
......@@ -483,6 +483,17 @@ class Boobank(CaptchaMixin, ReplApplication):
next(iter(self.do('add_recipient', error.recipient, **params)))
except CallErrors as e:
self.bcall_errors_handler(e)
elif isinstance(error, DecoupledValidation):
# XXX for now, assume we are in a add_recipient process.
print(error.message)
params = {'backends': backend,
'resume': True
}
try:
next(iter(self.do('add_recipient', error.resource, **params)))
except CallErrors as e:
self.bcall_errors_handler(e)
elif isinstance(error, TransferInvalidAmount):
print(u'Error(%s): %s' % (backend.name, to_unicode(error) or 'The transfer amount is invalid'), file=self.stderr)
elif isinstance(error, TransferInvalidLabel):
......
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