From e8cefd7910f807873a9f0d7650f6868ccffbeac0 Mon Sep 17 00:00:00 2001 From: kracekumar Date: Fri, 29 Sep 2017 12:48:14 +0530 Subject: [PATCH] Fix export votes --- junction/proposals/dashboard.py | 5 +++-- junction/proposals/views.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/junction/proposals/dashboard.py b/junction/proposals/dashboard.py index 640d636f..e3a7b845 100644 --- a/junction/proposals/dashboard.py +++ b/junction/proposals/dashboard.py @@ -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') + \ @@ -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'}) diff --git a/junction/proposals/views.py b/junction/proposals/views.py index 6aaf4374..e529b945 100644 --- a/junction/proposals/views.py +++ b/junction/proposals/views.py @@ -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,