mirror of
https://github.com/ae-utbm/sith.git
synced 2026-06-05 15:49:21 +00:00
automatically apply election results
This commit is contained in:
+2
-2
@@ -135,9 +135,9 @@ class Role(OrderedModel):
|
||||
|
||||
def results(self, total_vote: int) -> dict[str, dict[str, int | float]]:
|
||||
if total_vote == 0:
|
||||
candidates = self.candidatures.values_list("user__username")
|
||||
candidates = self.candidatures.values_list("user__username", flat=True)
|
||||
return {
|
||||
key: {"vote": 0, "percent": 0} for key in ["blank_votes", *candidates]
|
||||
key: {"vote": 0, "percent": 0} for key in ["blank vote", *candidates]
|
||||
}
|
||||
total_vote *= self.max_choice
|
||||
results = {"total vote": total_vote}
|
||||
|
||||
Reference in New Issue
Block a user