Correction clés étrangères

This commit is contained in:
Emmy D'Anello 2024-06-10 00:00:08 +02:00
parent 58ffe8a46a
commit 13b4dec209
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -85,8 +85,10 @@ def importer_resultats_regions(engine: Engine, debug: bool = False) -> None:
resultats_region.nuls = resultats["nuls"]
resultats_region.exprimes = resultats["exprimes"]
else:
resultats_france = session.execute(select(ResultatsFrance)).scalar_one()
resultats_region = ResultatsRegion(
region_id=reg_code,
resultats_france_id=resultats_france.id,
inscrits=resultats["inscrits"],
abstentions=resultats["abstentions"],
votants=resultats["votants"],