Skip to content

Contract: check that additionalBond exists before iterating over it

Administrator requested to merge fix/add-check-additionalBond-exists into master

Already applied in prod cause was breaking the "check-order-item" task.

OrderItems are presented with:

"additionalBonds": null,

Which causes the following error:

    return cls(**contract["orderDetail"])
  File "/home/mm-proxy/pyenv/versions/3.8.2/envs/somconnexio-mm-proxy/lib/python3.8/site-packages/pymasmovil/models/order_item.py", line 14, in __init__
    super().__init__(**kwargs)
  File "/home/mm-proxy/pyenv/versions/3.8.2/envs/somconnexio-mm-proxy/lib/python3.8/site-packages/pymasmovil/models/contract.py", line 56, in __init__
    for bond in value:
TypeError: 'NoneType' object is not iterable
Edited by Administrator

Merge request reports

Loading