From a1152af7ea9ede44af220451d2e90dfc28005bb6 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Sat, 14 Jul 2012 08:48:25 +0200 Subject: [PATCH] #288 fix type error if a poll has no votecast --- openslides/poll/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openslides/poll/models.py b/openslides/poll/models.py index e24494aad..a5beac578 100644 --- a/openslides/poll/models.py +++ b/openslides/poll/models.py @@ -82,7 +82,10 @@ class CountVotesCast(models.Model): return print_value(self.votescast) def percent_base(self): - return 100 / float(self.votescast) + try: + return 100 / float(self.votescast) + except TypeError: + return 0 class Meta: abstract = True