Skip to content

Commit

Permalink
Fix export votes
Browse files Browse the repository at this point in the history
  • Loading branch information
kracekumar committed Sep 29, 2017
1 parent bb38eef commit e8cefd7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions junction/proposals/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def export_reviewer_votes(request, conference_slug):
proposals_qs, key=lambda x: x.get_reviewer_votes_sum(), reverse=True)
vote_values_list = ProposalSectionReviewerVoteValue.objects.order_by(
'-vote_value')
vote_values_list = [v.vote_value for v in vote_values_list]
vote_values_desc = tuple(i.description
for i in ProposalSectionReviewerVoteValue.objects.order_by('-vote_value'))
header = ('Proposal Type', 'Title', 'Sum of reviewer votes', 'No. of reviewer votes') + \
Expand All @@ -327,11 +328,11 @@ def export_reviewer_votes(request, conference_slug):
vote_details + (p.get_votes_count(), vote_comment,)
if p.get_reviewer_votes_count_by_value(
ProposalSectionReviewerVoteValue.objects.get(
vote_value=ProposalReviewVote.NOT_ALLOWED)) > 0:
vote_value=ProposalReviewVote.NOT_ALLOWED).vote_value) > 0:
cell_format = book.add_format({'bg_color': 'red'})
elif p.get_reviewer_votes_count_by_value(
ProposalSectionReviewerVoteValue.objects.get(
vote_value=ProposalReviewVote.MUST_HAVE)) > 2:
vote_value=ProposalReviewVote.MUST_HAVE).vote_value) > 2:
cell_format = book.add_format({'bg_color': 'green'})
elif p.get_reviewer_votes_count() < 2:
cell_format = book.add_format({'bg_color': 'yellow'})
Expand Down
3 changes: 2 additions & 1 deletion junction/proposals/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ def proposals_to_review(request, conference_slug):
if p.proposal_section == section]
proposals_to_review.append(s_items(section, section_proposals))

form = ProposalsToReviewForm(conference=conference, proposal_sections=proposal_reviewer_sections)
form = ProposalsToReviewForm(conference=conference,
proposal_sections=proposal_reviewer_sections)

context = {
'proposals_to_review': proposals_to_review,
Expand Down

0 comments on commit e8cefd7

Please sign in to comment.