Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1211 from akatsoulas/1280585-show-voters
Browse files Browse the repository at this point in the history
[fix bug 1280585] Display who voted in range polls.
  • Loading branch information
akatsoulas authored Dec 21, 2016
2 parents 30bce34 + 3683821 commit 6679c4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions remo/voting/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def test_view_current_voting(self, faked_message):
@mock.patch('remo.voting.views.messages')
def test_view_cast_a_vote(self, fake_messages):
"""Cast a vote on a voting."""
UserFactory.create(username='remobot')
poll_start = now() - timedelta(days=5)
poll = PollFactory.create(valid_groups=self.rep_group, start=poll_start,
end=poll_start + timedelta(days=10),
Expand Down
5 changes: 5 additions & 0 deletions remo/voting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ def view_voting(request, slug):
radio_poll_form.save()

Vote.objects.create(user=user, poll=poll)
# Append a comment that the user voted successfully.
comment_msg = u'**{0}** voted successfully.'.format(user)
commenter = User.objects.get(username='remobot')
PollComment.objects.create(poll=poll, user=commenter, comment=comment_msg)

messages.success(request, u'Your vote has been successfully registered.')
statsd.incr('voting.vote_voting')
return redirect('voting_list_votings')
Expand Down

0 comments on commit 6679c4f

Please sign in to comment.