diff --git a/web/components/visualization/results-detaileds.js b/web/components/visualization/results-detaileds.js index 00f262c419436446f871f86ca2824753fad3add5..2818f532d0a5a3fba500fd4f7b451fefffaae3d1 100644 --- a/web/components/visualization/results-detaileds.js +++ b/web/components/visualization/results-detaileds.js @@ -196,6 +196,7 @@ class DetailedsResultsComponent { this.parent.parent.zone === "areas" && zone.stats.PercentageConsiderated == 100 ) { + if (zone.Electeds == undefined) return; let electedsZone = document.getElementById("zone-detaileds-results"); electedsZone.innerHTML = '<br/><h5 class="title is-5">Élus</h5>'; let electedList = document.createElement("ol"); diff --git a/web/services/election/calculate-election-generic.js b/web/services/election/calculate-election-generic.js index 36d8c30d2df243d88919a7196b0f8a2f6d097d38..a7ebaa1595d18303bd26044a4443dc5489eb8e61 100644 --- a/web/services/election/calculate-election-generic.js +++ b/web/services/election/calculate-election-generic.js @@ -384,6 +384,14 @@ class ElectionCalculator { } }); + //check that elected can be determined + if (this.round.Round == 1 && area.candidateLists[0].Percentage < 50) { + area.candidateLists.forEach((candidateList) => { + candidateList.SeatsAttributed = 0; + }); + return; + } + // première étape let seatForFirst = parseInt(area.SeatNumber / 2); if ((parseInt(area.seatNumber) / 2) % 2 != 0) seatForFirst += 1;