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
if poll.get_options().filter(candidate=candidate).exists():
option = AssignmentOption.objects.filter(poll=poll).get(candidate=candidate)
tmplist[1].append(option.get_votes()[0])
try:
tmplist[1].append(option.get_votes()[0])
except IndexError:
tmplist[1].append('')
else:
tmplist[1].append("-")
votes.append(tmplist)