fixed error in emty poll in assignment

This commit is contained in:
Oskar Hahn 2012-04-12 16:37:04 +02:00
parent fc95d01d07
commit 9e6aa796ab

View File

@ -81,7 +81,10 @@ def view(request, assignment_id=None):
# exisitiert der Spieler in der poll # exisitiert der Spieler in der poll
if poll.get_options().filter(candidate=candidate).exists(): if poll.get_options().filter(candidate=candidate).exists():
option = AssignmentOption.objects.filter(poll=poll).get(candidate=candidate) option = AssignmentOption.objects.filter(poll=poll).get(candidate=candidate)
try:
tmplist[1].append(option.get_votes()[0]) tmplist[1].append(option.get_votes()[0])
except IndexError:
tmplist[1].append('')
else: else:
tmplist[1].append("-") tmplist[1].append("-")
votes.append(tmplist) votes.append(tmplist)