Commit 7a598e45 authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[sgpe] handle incorrect password for 'societe generale entreprise'

parent 522ac040
......@@ -31,7 +31,7 @@ from weboob.capabilities.base import Currency
from weboob.capabilities import NotAvailable
from weboob.capabilities.bank import Account
from weboob.capabilities.bill import Document, Subscription
from weboob.exceptions import BrowserUnavailable, NoAccountsException
from weboob.exceptions import BrowserUnavailable, NoAccountsException, BrowserIncorrectPassword
from weboob.tools.capabilities.bank.iban import is_iban_valid
from weboob.tools.capabilities.bank.transactions import FrenchTransaction
from weboob.tools.compat import quote_plus
......@@ -56,10 +56,12 @@ class AccountsJsonPage(LoggedPage, JsonPage):
}
def on_load(self):
if self.doc['commun']['statut'] == 'NOK':
if self.doc['commun']['statut'].lower() == 'nok':
reason = self.doc['commun']['raison']
if reason == 'SYD-COMPTES-UNAUTHORIZED-ACCESS':
raise NoAccountsException("Vous n'avez pas l'autorisation de consulter : {}".format(reason))
elif reason == 'niv_auth_insuff':
raise BrowserIncorrectPassword('Vos identifiants sont incorrects')
raise BrowserUnavailable(reason)
@method
......
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