diff --git a/modules/ing/api_browser.py b/modules/ing/api_browser.py index 9e90636674d925d3302ae9cc7f2c82450fa537b0..2410549cfa9eadff864c1a819cb0342be2c3f700 100644 --- a/modules/ing/api_browser.py +++ b/modules/ing/api_browser.py @@ -309,20 +309,18 @@ def get_api_accounts(self): # If the balance is 0, the details page throws an error 500 if account.type == Account.TYPE_LIFE_INSURANCE: if account.balance != 0: - self.life_insurance.go( + # Prefer do an open() NOT to set the life insurance url as next Referer. + # If the Referer doesn't point to /secure, the site might do error 500... + page = self.life_insurance.open( account_uid=account._uid, headers={ 'Authorization': 'Bearer %s' % self.get_invest_token(), } ) - self.page.fill_account(obj=account) + page.fill_account(obj=account) yield account - # The life insurance page is on a different space, - # sometimes we get an error 500 if we don't go back to this page - self.context.go() - @need_login def iter_matching_accounts(self): """Do accounts matching for old and new website"""