summaryrefslogtreecommitdiff
path: root/papillon
diff options
context:
space:
mode:
Diffstat (limited to 'papillon')
-rw-r--r--papillon/polls/views.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/papillon/polls/views.py b/papillon/polls/views.py
index e9ef572..300b313 100644
--- a/papillon/polls/views.py
+++ b/papillon/polls/views.py
@@ -455,8 +455,7 @@ def poll(request, poll_url):
if choice.id not in choice_vote_ids:
vote = Vote(voter=voter, choice=choice, value=None)
vote.save()
- idx = choices.index(choice)
- voter.votes.insert(idx, vote)
+ voter.votes.sort(lambda x, y : cmp(choices.index(x.choice), choices.index(y.choice)))
sums = [choice.getSum(poll.type == 'B') for choice in choices]
vote_max = max(sums)
c_idx = 0