Projet

Général

Profil

0004-to-be-fixed-up-add-comment-about-our-heuristic-when-.patch

Benjamin Dauvergne, 13 juillet 2021 16:42

Télécharger (1,11 ko)

Voir les différences:

Subject: [PATCH 4/5] to be fixed up: add comment about our heuristic when BAN
 id has changed

 passerelle/apps/base_adresse/models.py | 3 +++
 1 file changed, 3 insertions(+)
passerelle/apps/base_adresse/models.py
184 184
            for result in results:  # match by id if possible
185 185
                if result['ban_id'] == ban_id:
186 186
                    return {'data': [result]}
187
            # in the hypothetical case that the ban_id has changed, instead of
188
            # returning an error we bet that the first result is the good one,
189
            # at least the nearest from the one we search.
187 190
            return results
188 191
        else:  # retrocompatibility with raw BAN id
189 192
            return {'err': _('Address ID not found')}
190
-