fedora_elections/models.py | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
New commits:
commit 1865d4f6da417788f85af6481e87922f9615d639
Merge: 996c4ea 065f677
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Thu May 21 17:37:11 2015 +0200
Merge pull request #46 from fedora-infra/fix_resultspage
Fix setting the max_vote value in the stats dict for the results page
commit 065f6779977b1531f686c88df945ab3233321de9
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Thu May 21 16:21:59 2015 +0200
Fix setting the max_vote value in the stats dict for the results page
diff --git a/fedora_elections/models.py b/fedora_elections/models.py
index 8f80914..dff7cc4 100644
--- a/fedora_elections/models.py
+++ b/fedora_elections/models.py
@@ -414,14 +414,12 @@ class Vote(BASE):
stats['candidate_voters'] = candidate_voters
stats['n_candidates'] = cnt
- if election.voting_type in ['range', 'select']:
+ stats['max_vote'] = 1
+ if election.voting_type == 'select' \
+ or election.voting_type.startswith('range'):
stats['max_vote'] = cnt
if election.max_votes:
stats['max_vote'] = election.max_votes
- elif election.voting_type == 'simple':
- stats['max_vote'] = 1
- elif election.voting_type == 'irc':
- stats['max_vote'] = 1
dates = election = session.query(
Vote.timestamp
Show replies by date