Réduction des petites erreurs qui polluent les logs
This commit is contained in:
@@ -2,6 +2,7 @@ import polars as pl
|
|||||||
from dash import Input, Output, callback, dcc, html, register_page
|
from dash import Input, Output, callback, dcc, html, register_page
|
||||||
|
|
||||||
from src.db import get_cursor
|
from src.db import get_cursor
|
||||||
|
from src.utils import logger
|
||||||
from src.utils.data import DF_ACHETEURS, DF_TITULAIRES
|
from src.utils.data import DF_ACHETEURS, DF_TITULAIRES
|
||||||
|
|
||||||
NAME = "Liste des marchés publics"
|
NAME = "Liste des marchés publics"
|
||||||
@@ -27,9 +28,12 @@ def make_org_nom_verbe(org_type, org_id) -> tuple:
|
|||||||
|
|
||||||
|
|
||||||
def get_title(code, org_type, org_id):
|
def get_title(code, org_type, org_id):
|
||||||
org_nom, verbe = make_org_nom_verbe(org_type, org_id)
|
if org_type:
|
||||||
|
org_nom, verbe = make_org_nom_verbe(org_type, org_id)
|
||||||
return f"Marchés publics {verbe} par {org_nom} | decp.info"
|
return f"Marchés publics {verbe} par {org_nom} | decp.info"
|
||||||
|
else:
|
||||||
|
logger.warning(f"Pas de org_type pour org_id: {org_id}")
|
||||||
|
return "Marchés publics | decp.info"
|
||||||
|
|
||||||
|
|
||||||
def get_description(code, org_type, org_id):
|
def get_description(code, org_type, org_id):
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ from dash import Input, Output, State, callback, ctx, dcc, html, register_page
|
|||||||
|
|
||||||
from src.utils.seo import META_CONTENT
|
from src.utils.seo import META_CONTENT
|
||||||
|
|
||||||
NAME = "Quelles données pour quelles étapes et quels seuils ?"
|
NAME = "Quelles données pour quelles étapes et quels seuils dans les marchés publics ?"
|
||||||
|
|
||||||
register_page(
|
register_page(
|
||||||
__name__,
|
__name__,
|
||||||
@@ -293,5 +293,5 @@ def _show_detail(*args):
|
|||||||
return None, None
|
return None, None
|
||||||
content = ALL_CONTENT.get(triggered)
|
content = ALL_CONTENT.get(triggered)
|
||||||
if content is None:
|
if content is None:
|
||||||
return dcc.Markdown("*Fiche en cours de rédaction.*"), triggered
|
return dcc.Markdown(f"*Fiche en cours de rédaction.* {triggered}"), triggered
|
||||||
return dcc.Markdown(content), triggered
|
return dcc.Markdown(content), triggered
|
||||||
|
|||||||
+2
-1
@@ -109,7 +109,7 @@ def update_marche_info(marche, titulaires):
|
|||||||
column_object = DATA_SCHEMA.get(col)
|
column_object = DATA_SCHEMA.get(col)
|
||||||
column_name = column_object.get("title") if column_object else col
|
column_name = column_object.get("title") if column_object else col
|
||||||
|
|
||||||
if col in marche:
|
if marche and col in marche:
|
||||||
if col == "acheteur_nom":
|
if col == "acheteur_nom":
|
||||||
value = html.A(
|
value = html.A(
|
||||||
href=f"/acheteurs/{marche['acheteur_id']}",
|
href=f"/acheteurs/{marche['acheteur_id']}",
|
||||||
@@ -134,6 +134,7 @@ def update_marche_info(marche, titulaires):
|
|||||||
"considerationsSociales",
|
"considerationsSociales",
|
||||||
"considerationsEnvironnementales",
|
"considerationsEnvironnementales",
|
||||||
]
|
]
|
||||||
|
and col in marche
|
||||||
and "," in marche[col]
|
and "," in marche[col]
|
||||||
):
|
):
|
||||||
col_values = marche[col].split(", ")
|
col_values = marche[col].split(", ")
|
||||||
|
|||||||
+10
-8
@@ -53,14 +53,16 @@ def get_departements_geojson() -> dict:
|
|||||||
return geojson
|
return geojson
|
||||||
|
|
||||||
|
|
||||||
def get_departement_region(code_postal):
|
def get_departement_region(code_postal: str | None):
|
||||||
if code_postal > "97000":
|
if code_postal:
|
||||||
code_departement = code_postal[:3]
|
if code_postal > "97000":
|
||||||
else:
|
code_departement = code_postal[:3]
|
||||||
code_departement = code_postal[:2]
|
else:
|
||||||
nom_departement = DEPARTEMENTS[code_departement]["departement"]
|
code_departement = code_postal[:2]
|
||||||
nom_region = DEPARTEMENTS[code_departement]["region"]
|
nom_departement = DEPARTEMENTS[code_departement]["departement"]
|
||||||
return code_departement, nom_departement, nom_region
|
nom_region = DEPARTEMENTS[code_departement]["region"]
|
||||||
|
return code_departement, nom_departement, nom_region
|
||||||
|
return "", "", ""
|
||||||
|
|
||||||
|
|
||||||
def get_data_schema() -> dict:
|
def get_data_schema() -> dict:
|
||||||
|
|||||||
Reference in New Issue
Block a user