Show results for elected candidates only (assignment beamer view).

This commit is contained in:
Emanuel Schuetze 2011-09-21 21:21:01 +02:00
parent 28d7d17587
commit bd9891fe5e

View File

@ -120,11 +120,14 @@ def assignment_votes(item):
for poll in assignment.poll_set.all(): for poll in assignment.poll_set.all():
if poll.published: if poll.published:
if candidate in poll.options_values: if candidate in poll.options_values:
option = Option.objects.filter(poll=poll).filter(user=candidate)[0] if assignment.is_elected(candidate):
if poll.optiondecision: option = Option.objects.filter(poll=poll).filter(user=candidate)[0]
tmplist[1].append([option.yes, option.no, option.undesided]) if poll.optiondecision:
tmplist[1].append([option.yes, option.no, option.undesided])
else:
tmplist[1].append(option.yes)
else: else:
tmplist[1].append(option.yes) tmplist[1].append("")
else: else:
tmplist[1].append("-") tmplist[1].append("-")
votes.append(tmplist) votes.append(tmplist)