Réduction des petites erreurs qui polluent les logs

This commit is contained in:
Colin Maudry
2026-06-07 18:56:16 +02:00
parent 4d3e8ac344
commit ed32b0f66b
4 changed files with 21 additions and 14 deletions
+10 -8
View File
@@ -53,14 +53,16 @@ def get_departements_geojson() -> dict:
return geojson
def get_departement_region(code_postal):
if code_postal > "97000":
code_departement = code_postal[:3]
else:
code_departement = code_postal[:2]
nom_departement = DEPARTEMENTS[code_departement]["departement"]
nom_region = DEPARTEMENTS[code_departement]["region"]
return code_departement, nom_departement, nom_region
def get_departement_region(code_postal: str | None):
if code_postal:
if code_postal > "97000":
code_departement = code_postal[:3]
else:
code_departement = code_postal[:2]
nom_departement = DEPARTEMENTS[code_departement]["departement"]
nom_region = DEPARTEMENTS[code_departement]["region"]
return code_departement, nom_departement, nom_region
return "", "", ""
def get_data_schema() -> dict: