Allow transfer with weboob identifiers

This commit is contained in:
Florent 2012-09-25 16:35:09 +02:00 committed by Romain Bignon
commit e128fcc2e2

View file

@ -21,7 +21,7 @@
# python2.5 compatibility # python2.5 compatibility
from __future__ import with_statement from __future__ import with_statement
from weboob.capabilities.bank import ICapBank, AccountNotFound, Account from weboob.capabilities.bank import ICapBank, AccountNotFound, Account, Recipient
from weboob.tools.backend import BaseBackend, BackendConfig from weboob.tools.backend import BaseBackend, BackendConfig
from weboob.tools.value import ValueBackendPassword from weboob.tools.value import ValueBackendPassword
@ -84,4 +84,8 @@ class INGBackend(BaseBackend, ICapBank):
with self.browser: with self.browser:
if not isinstance(account, Account): if not isinstance(account, Account):
account = self.get_account(account) account = self.get_account(account)
if not isinstance(recipient, Recipient):
# Remove weboob identifier prefix (LA-, CC-...)
if "-" in recipient:
recipient = recipient[3:]
return self.browser.transfer(account, recipient, amount, reason) return self.browser.transfer(account, recipient, amount, reason)