Skip to content

Commit

Permalink
Merge pull request #236 from ChillarAnand/flake
Browse files Browse the repository at this point in the history
fix flake8 errors
  • Loading branch information
kracekumar committed May 17, 2015
2 parents ad562f8 + c55a0be commit 019c61f
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions junction/proposals/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,13 @@ def proposal_comment_down_vote(request, conference_slug, proposal_slug,


@login_required
@require_http_methods(['GET'])
def dashboard(request, conference_slug):
conference = get_object_or_404(Conference, slug=conference_slug)

if not request.user.is_superuser:
return HttpResponseForbidden()

proposals_qs = Proposal.objects.filter(
conference=conference,
status=PROPOSAL_STATUS_PUBLIC)
Expand Down Expand Up @@ -436,19 +440,20 @@ def dashboard(request, conference_slug):
key_id,
[proposal_qs.count(), 0, 0, section.proposal_section.name])
for proposal in proposal_qs:
private_comment_count = ProposalComment.objects.filter(proposal=proposal,
deleted=False, private=True).count()
private_comment_count = ProposalComment.objects.filter(
proposal=proposal, deleted=False, private=True).count()
if private_comment_count:
by_reviewer[key_id][1] = by_reviewer[key_id][1] + 1
else:
by_reviewer[key_id][2] = by_reviewer[key_id][2] + 1

ctx = {'conference': conference,
'total': proposals_qs.count(),
'reviewed': reviewed_count,
'unreviewed': unreviewed_count,
'group_by_type': by_type,
'group_by_section': by_section,
'group_by_reviewer_section': by_reviewer}
ctx = {
'conference': conference,
'total': proposals_qs.count(),
'reviewed': reviewed_count,
'unreviewed': unreviewed_count,
'group_by_type': by_type,
'group_by_section': by_section,
'group_by_reviewer_section': by_reviewer
}

return render(request, 'proposals/dashboard.html', ctx)

0 comments on commit 019c61f

Please sign in to comment.