Skip to content

[hsbc] Fix retrieval of parent account for deffered debit cards.

Woob Import requested to merge fix-parent-id-retrival into master

This MR fixes a change in the way accounts attached to credit cards are displayed. The current code leads to the following error:

Bug(hsbc): 'NoneType' object has no attribute 'group'
Traceback (most recent call last):
  File "/home/tonio/.local/lib/python3.7/site-packages/weboob/core/bcall.py", line 106, in backend_process
    for subresult in result:
  File "/home/tonio/.local/lib/python3.7/site-packages/weboob/tools/application/base.py", line 297, in _do_complete_iter
    for i, sub in enumerate(res):
  File "/home/tonio/Code/weboob/modules/hsbc/module.py", line 54, in iter_accounts
    for account in self.browser.iter_account_owners():
  File "/home/tonio/Code/weboob/modules/hsbc/browser.py", line 271, in iter_account_owners
    parent_id = re.match(r'^(\d*)?(\d{11}.EUR)$', card[1]).group(2)  # ids in the HTML have 5 numbers added at the beginning, catch only the end
AttributeError: 'NoneType' object has no attribute 'group'

Merge request reports