Skip to content

[server] Fix weboob call with accesses without custom fields

This fixes a bug I discovered when editing the fakeweboobbank module by removing any custom field from fakeweboobbank/module.py + banks.json.

When creating an access the returned access only has a fields property if the array is not empty. But when calling weboob later with this access instance, we do not expect the fields property to no exist: https://framagit.org/kresusapp/kresus/-/blob/master/server/lib/sources/weboob.js#L83.

Error:

[5] [2020-03-24T14:57:40.395] [INFO] accounts-manager - Retrieve all accounts from access fakeweboobbank with login noerror
[5] [2020-03-24T14:57:40.398] [INFO] sources/weboob - Calling weboob: command accounts...
[5] [2020-03-24T14:57:40.404] [ERROR] sources/weboob - Got error while running command "accounts": fields is not iterable
[5] [2020-03-24T14:57:40.404] [ERROR] controllers/accesses - The access process creation failed, cleaning up...
[5] [2020-03-24T14:57:40.405] [INFO] controllers/accesses -     deleting access...
[5] [2020-03-24T14:57:40.415] [ERROR] helpers - when creating a bank access: fields is not iterable

I can also reproduce with the paypal module.

This is a regression from c4439497

Edited by Nicolas Frandeboeuf

Merge request reports