Commit f504ccb1 authored by Florian Duguet's avatar Florian Duguet Committed by Romain Bignon

[societegenerale] raise BrowserUnavailable when json response return 'NOK'

Closes: 589974@redmine
parent e3a8688b
......@@ -26,6 +26,7 @@ from weboob.browser.filters.json import Dict
from weboob.capabilities.base import Currency
from weboob.capabilities import NotAvailable
from import Account
from weboob.exceptions import BrowserUnavailable
from import is_iban_valid
from import FrenchTransaction
......@@ -81,6 +82,10 @@ class AccountsJsonPage(LoggedPage, JsonPage):
class BalancesJsonPage(LoggedPage, JsonPage):
def on_load(self):
if self.doc['commun']['statut'] == 'NOK':
raise BrowserUnavailable(self.doc['commun']['raison'])
def populate_balances(self, accounts):
for account in accounts:
acc_dict = self.doc['donnees']['compteSoldesMap'][account._id]
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