[lita] Error when login
On login, I had this issue :
'NoneType' object has no attribute 'do_login'
With more verbosity, I found this logs :
2024-04-18 14:28:07,411:DEBUG:woob.core.bcall:3.6:bcall.py:86:backend_process <Backend lita>: Calling function <bound method Application._do_complete of <woob.applications.bank.bank.Appbank object at 0x77fcb730f370>>
2024-04-18 14:28:07,411:DEBUG:woob.core.bcall:3.6:bcall.py:95:backend_process <Backend lita>: Called function <bound method Application._do_complete of <woob.applications.bank.bank.Appbank object at 0x77fcb730f370>> returned: <generator object Application._do_complete_iter at 0x77fcb3e81690>
2024-04-18 14:28:07,438:DEBUG:urllib3.connectionpool:3.6:connectionpool.py:549:_make_request https://fr.lita.co:443 "GET /users/sign_in HTTP/1.1" 302 None
2024-04-18 14:28:07,504:DEBUG:urllib3.connectionpool:3.6:connectionpool.py:549:_make_request https://fr.lita.co:443 "GET /en/users/sign_in HTTP/1.1" 200 None
2024-04-18 14:28:07,507:DEBUG:woob.backend.lita.browser:3.6:browsers.py:1018:internal_callback Unable to handle https://fr.lita.co/en/users/sign_in
which indicates that after getting https://fr.lita.co/en/users/sign_in
it failed to handle the page.
So self.page
remains to None, and so we get the initial error 'NoneType' object has no attribute 'do_login'
I managed to get it handle the page by changing the urls, and adding the prefix "/fr" to every urls :
login = URL(r'/fr/users/sign_in', LoginPage)
dashboard = URL(r'/fr/investors/dashboard', DashboardPage)
profile = URL(r'/fr/investors/identity/edit', ProfilePage)
investments_list = URL(r'/fr/investors/subscriptions$', InvestmentsListPage)
investments_details = URL(r'/fr/investors/subscriptions/(?P<id>\d+)/shares', InvestmentsDetailsPage)
It works, I can connect now and list my accounts. But I don't know if its the correct way, as it would probably fail for not "fr" users.