Commit f006df3b authored by ntome's avatar ntome Committed by Romain Bignon

[bred] fetch checking account iban only from fillobj

With PSD2 law, TPP (third party agregators) should only access checking
accounts web pages if bank APIs don't work.
So, only visit those pages explictly through fillobj, not always in
iter_accounts.
parent 02bffb5f
......@@ -135,9 +135,6 @@ class BredBrowser(LoginBrowser):
def get_list(self):
self.accounts.go()
for acc in self.page.iter_accounts(accnum=self.accnum, current_univers=self.current_univers):
if acc.type == Account.TYPE_CHECKING:
self.iban.go(number=acc._number)
self.page.set_iban(account=acc)
yield acc
@need_login
......@@ -227,3 +224,9 @@ class BredBrowser(LoginBrowser):
self.page.set_email(profile=profile)
return profile
@need_login
def fill_account(self, account, fields):
if account.type == Account.TYPE_CHECKING and 'iban' in fields:
self.iban.go(number=account._number)
self.page.set_iban(account=account)
......@@ -18,7 +18,7 @@
# along with this weboob module. If not, see <http://www.gnu.org/licenses/>.
from weboob.capabilities.bank import CapBankWealth, AccountNotFound
from weboob.capabilities.bank import CapBankWealth, AccountNotFound, Account
from weboob.capabilities.base import find_object
from weboob.capabilities.profile import CapProfile
from weboob.tools.backend import Module, BackendConfig
......@@ -73,3 +73,13 @@ class BredModule(Module, CapBankWealth, CapProfile):
def get_profile(self):
return self.browser.get_profile()
def fill_account(self, account, fields):
if self.config['website'].get() != 'bred':
return
self.browser.fill_account(account, fields)
OBJECTS = {
Account: fill_account,
}
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