diff --git a/lemarche/utils/apis/api_qpv.py b/lemarche/utils/apis/api_qpv.py index 0aff51509..1a80470a6 100644 --- a/lemarche/utils/apis/api_qpv.py +++ b/lemarche/utils/apis/api_qpv.py @@ -47,7 +47,11 @@ def is_in_qpv(latitude, longitude, distance=DISTANCE_TO_VALIDATE_QPV, client=Non records = data["records"] if records: qpv = records[0] - return {IS_QPV_KEY: True, QPV_NAME_KEY: qpv["fields"]["nom_qp"], QPV_CODE_KEY: qpv["fields"]["code_qp"]} + return { + IS_QPV_KEY: True, + QPV_NAME_KEY: qpv["fields"]["nom_qp"], + QPV_CODE_KEY: qpv["fields"]["identifiant"], + } return {IS_QPV_KEY: False} except requests.exceptions.HTTPError as e: logger.error("Error while fetching `%s`: %s", e.request.url, e)