|
16 | 16 | from xlsxwriter.workbook import Workbook
|
17 | 17 |
|
18 | 18 | # Junction Stuff
|
19 |
| -from junction.base.constants import ProposalReviewVote, ProposalStatus, ProposalVotesFilter |
| 19 | +from junction.base.constants import ( |
| 20 | + ProposalReviewVote, |
| 21 | + ProposalStatus, |
| 22 | + ProposalVotesFilter |
| 23 | +) |
20 | 24 | from junction.conferences.models import Conference, ConferenceProposalReviewer
|
21 | 25 |
|
22 | 26 | from .forms import ProposalVotesFilterForm
|
@@ -146,8 +150,8 @@ def reviewer_comments_dashboard(request, conference_slug):
|
146 | 150 | by_conference[id][1] = ProposalComment.objects.filter(
|
147 | 151 | commenter=reviewers.reviewer,
|
148 | 152 | deleted=False, private=True,
|
149 |
| - proposal__status=ProposalStatus.PUBLIC, |
150 |
| - proposal__conference=conference).count() |
| 153 | + proposal__status=ProposalStatus.PUBLIC, |
| 154 | + proposal__conference=conference).distinct('proposal').count() |
151 | 155 | # by_section is dict with
|
152 | 156 | # find each reviewers section and their comments
|
153 | 157 | # Need to rework on this code section to make it 1-2 loops
|
@@ -243,7 +247,8 @@ def reviewer_votes_dashboard(request, conference_slug):
|
243 | 247 | p for p in proposals_qs if p.get_reviewer_votes_count() >= votes]
|
244 | 248 | elif votes == ProposalVotesFilter.SORT:
|
245 | 249 | proposals_qs = sorted(
|
246 |
| - proposals_qs, key=lambda x: x.get_reviewer_votes_sum(), reverse=True) |
| 250 | + proposals_qs, key=lambda x: x.get_reviewer_votes_sum(), |
| 251 | + reverse=True) |
247 | 252 |
|
248 | 253 | for section in proposal_sections:
|
249 | 254 | section_proposals = [
|
@@ -299,10 +304,12 @@ def export_reviewer_votes(request, conference_slug):
|
299 | 304 | p.get_reviewer_votes_count(),) + \
|
300 | 305 | vote_details + (p.get_votes_count(), vote_comment,)
|
301 | 306 | if p.get_reviewer_votes_count_by_value(
|
302 |
| - ProposalSectionReviewerVoteValue.objects.get(vote_value=ProposalReviewVote.NOT_ALLOWED)) > 0: |
| 307 | + ProposalSectionReviewerVoteValue.objects.get( |
| 308 | + vote_value=ProposalReviewVote.NOT_ALLOWED)) > 0: |
303 | 309 | cell_format = book.add_format({'bg_color': 'red'})
|
304 | 310 | elif p.get_reviewer_votes_count_by_value(
|
305 |
| - ProposalSectionReviewerVoteValue.objects.get(vote_value=ProposalReviewVote.MUST_HAVE)) > 2: |
| 311 | + ProposalSectionReviewerVoteValue.objects.get( |
| 312 | + vote_value=ProposalReviewVote.MUST_HAVE)) > 2: |
306 | 313 | cell_format = book.add_format({'bg_color': 'green'})
|
307 | 314 | elif p.get_reviewer_votes_count() < 2:
|
308 | 315 | cell_format = book.add_format({'bg_color': 'yellow'})
|
|
0 commit comments