aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2024-06-28 23:25:19 +0300
committerJan Tuomi <jan@jantuomi.fi>2024-12-21 19:43:13 +0200
commit737302e1c18c71ac55c7e241c8ef30003ad64f97 (patch)
tree9323fb48b408fdd5c99d92d99f5ae053fcd9271e
parent5cc4e8998f31f0063fa71a7a25902a31f12a4a92 (diff)
Fix issue where 0 votes would be marked as most voted
-rw-r--r--app.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/app.py b/app.py
index 021cec7..c32afe2 100644
--- a/app.py
+++ b/app.py
@@ -164,7 +164,7 @@ def poll(id):
voter_names.sort()
most_voted_choice_ids: set[str] = set()
- most_voted_value = 0
+ most_voted_value = 1 # start from 1 to avoid marking 0 votes as most voted
for choice in poll.choices:
n_votes = 0
for vote in choice.votes: