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 #1267 from akatsoulas/1308910-voting-perms
Browse files Browse the repository at this point in the history
[fix bug 1308910] Fix voting permissions.
  • Loading branch information
akatsoulas authored Oct 18, 2016
2 parents 3b47e7f + bc81786 commit cd6f125
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions remo/voting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ def view_voting(request, slug):
poll = get_object_or_404(Poll, slug=slug)

is_council = request.user.groups.filter(name='Council').exists()
is_peer = request.user.groups.filter(name='Peers').exists()
is_peer = user.groups.filter(name='Peers').exists()
is_review_poll = poll.valid_groups.name == 'Review'
read_only_perms = is_peer or (is_council and is_review_poll)
user_should_vote = user.groups.filter(id=poll.valid_groups.id).exists()
read_only_perms = (is_peer or (is_council and is_review_poll)) and not user_should_vote

# If the user does not belong to a valid poll group
if not user_has_poll_permissions(user, poll) and not read_only_perms:
Expand Down

0 comments on commit cd6f125

Please sign in to comment.