From 3f5ee591b6b44b254b17673665e88f4d4a3b27c5 Mon Sep 17 00:00:00 2001 From: Scott Bragg Date: Mon, 15 Aug 2016 18:56:54 +1000 Subject: [PATCH] Revert "(un-oops)" --- symposion/reviews/views.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/symposion/reviews/views.py b/symposion/reviews/views.py index 7139a98e..e74a1193 100644 --- a/symposion/reviews/views.py +++ b/symposion/reviews/views.py @@ -257,16 +257,13 @@ def review_admin(request, section_slug): continue already_seen.add(user.pk) - user.comment_count = Review.objects.filter( - user=user, - proposal__kind__section__slug=section_slug, - ).count() - + user.comment_count = Review.objects.filter(user=user).count() user_votes = LatestVote.objects.filter( user=user, proposal__kind__section__slug=section_slug, ) - + print section_slug + print [vote.proposal.kind.section.slug for vote in user_votes] user.total_votes = user_votes.exclude( vote=LatestVote.VOTES.ABSTAIN, ).count() @@ -285,23 +282,19 @@ def review_admin(request, section_slug): user.abstain = user_votes.filter( vote=LatestVote.VOTES.ABSTAIN, ).count() - if user.total_votes == 0: user.average = "-" else: user.average = ( - ((user.plus_two * 2) + user.plus_one) - - ((user.minus_two * 2) + user.minus_one) + user.plus_two + user.plus_one + + user.minus_one + user.minus_two ) / (user.total_votes * 1.0) yield user - reviewers_sorted = list(reviewers()) - sort(reviewers_sorted: key= lambda reviewer: 0 - reviewer.total_votes) - ctx = { "section_slug": section_slug, - "reviewers": reviewers_sorted, + "reviewers": reviewers(), } return render(request, "symposion/reviews/review_admin.html", ctx)