From 5e8009649dfd4f201b1368ae0aa3600946d1edd8 Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Thu, 16 May 2019 15:13:30 +0200 Subject: [PATCH] [bforbank] Repair cards URL The cards URL was obsolete and all the connections containing deferred cards return a 404 during the iter_accounts. The 'tableauDeBord' is obsolete, now the cards URL is only 'operations'. Closes: 41275@sibi --- modules/bforbank/browser.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/modules/bforbank/browser.py b/modules/bforbank/browser.py index 891ca7340b..54bec9e1b2 100644 --- a/modules/bforbank/browser.py +++ b/modules/bforbank/browser.py @@ -111,7 +111,7 @@ def iter_accounts(self): cards = self.page.get_cards(account.id) account._cards = cards if cards: - self.location(account.url.replace('tableauDeBord', 'encoursCarte') + '/0') + self.location(account.url.replace('operations', 'encoursCarte') + '/0') indexes = dict(self.page.get_card_indexes()) for card in cards: @@ -122,9 +122,9 @@ def iter_accounts(self): card._checking_account = account card._index = indexes[card.number] - self.location(account.url.replace('tableauDeBord', 'encoursCarte') + '/%s' % card._index) + self.location(account.url.replace('operations', 'encoursCarte') + '/%s' % card._index) if self.page.get_debit_date().month == (datetime.date.today() + relativedelta(months=1)).month: - self.location(account.url.replace('tableauDeBord', 'encoursCarte') + '/%s?month=1' % card._index) + self.location(account.url.replace('operations', 'encoursCarte') + '/%s?month=1' % card._index) card.balance = 0 card.coming = self.page.get_balance() assert not empty(card.coming) @@ -134,11 +134,6 @@ def iter_accounts(self): return iter(self.accounts) - def _get_card_transactions(self, account): - self.location(account.url.replace('tableauDeBord', 'encoursCarte') + '/%s?month=1' % account._index) - assert self.card_history.is_here() - return self.page.get_operations() - @need_login def get_history(self, account): if account.type == Account.TYPE_LOAN: @@ -161,7 +156,7 @@ def get_history(self, account): return self.spirica.iter_history(account) if account.type != Account.TYPE_CARD: - self.location(account.url.replace('tableauDeBord', 'operations')) + self.location(account.url) assert self.history.is_here() or self.loan_history.is_here() transactions_list = [] if account.type == Account.TYPE_CHECKING: @@ -177,7 +172,7 @@ def get_history(self, account): # for summary transactions, the transactions must be on both accounts: # negative amount on checking account, positive on card account transactions = [] - self.location(account.url.replace('tableauDeBord', 'encoursCarte') + '/%s?month=1' % account._index) + self.location(account.url.replace('operations', 'encoursCarte') + '/%s?month=1' % account._index) if self.page.get_debit_date().month == (datetime.date.today() - relativedelta(months=1)).month: transactions = list(self.page.get_operations()) summary = self.page.create_summary() @@ -191,10 +186,10 @@ def get_coming(self, account): self.coming.go(account=account.id) return self.page.get_operations() elif account.type == Account.TYPE_CARD: - self.location(account.url.replace('tableauDeBord', 'encoursCarte') + '/%s' % account._index) + self.location(account.url.replace('operations', 'encoursCarte') + '/%s' % account._index) transactions = list(self.page.get_operations()) if self.page.get_debit_date().month == (datetime.date.today() + relativedelta(months=1)).month: - self.location(account.url.replace('tableauDeBord', 'encoursCarte') + '/%s?month=1' % account._index) + self.location(account.url.replace('operations', 'encoursCarte') + '/%s?month=1' % account._index) transactions += list(self.page.get_operations()) return sorted_transactions(transactions) else: -- GitLab