Skip to content
Snippets Groups Projects
Commit fe58882f authored by maxime_senza's avatar maxime_senza
Browse files

testing views total_votes

parent 9dcffff8
No related branches found
No related tags found
1 merge request!1Feature : sib polls
Pipeline #5660 canceled
...@@ -21,7 +21,7 @@ class TotalVotes(APIView) : ...@@ -21,7 +21,7 @@ class TotalVotes(APIView) :
#calcute the number of votes per choice #calcute the number of votes per choice
for choice in vote.chosenOption.userVote.all(): for choice in vote.chosenOption.userVote.all():
#get the number of voter per option and count them #get the number of voter per option and count them
total_votes = votes.filter(name=choice).count() total_votes = votes.filter(userVote=choice).count()
choices.append((choice.name, total_votes)) choices.append((choice.name, total_votes))
# return response with choices in content # return response with choices in content
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment