0001-base_adresse-set-result-id-to-lookup-id-72263.patch
passerelle/apps/base_adresse/models.py | ||
---|---|---|
198 | 198 |
results = self.addresses(request, q=q, lat=lat, lon=lon, citycode=citycode)['data'] |
199 | 199 |
for result in results: # match by id if possible |
200 | 200 |
if result['ban_id'] == ban_id: |
201 |
# Keep the original id if the client revalidate the |
|
202 |
# response before accepting it (like w.c.s. does). |
|
203 |
# id can change if street name changes (case change for |
|
204 |
# example). |
|
205 |
# See https://dev.entrouvert.org/issues/72263 |
|
206 |
result = result.copy() |
|
207 |
result['id'] = id |
|
201 | 208 |
return {'data': [result]} |
202 | 209 |
self.logger.error('get_by_id: id %s was not found', id) |
203 | 210 |
return {'err': _('Address ID not found')} |
204 |
- |