From 4e5884bda458da62aea83391e83a97304d51f494 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Mon, 16 Jul 2012 14:10:56 +0200 Subject: [PATCH] #298 fix problem with a votecast of 0, -1 and -2 --- openslides/poll/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openslides/poll/models.py b/openslides/poll/models.py index a5beac578..7f8a72ff2 100644 --- a/openslides/poll/models.py +++ b/openslides/poll/models.py @@ -82,10 +82,9 @@ class CountVotesCast(models.Model): return print_value(self.votescast) def percent_base(self): - try: + if self.votescast > 0: return 100 / float(self.votescast) - except TypeError: - return 0 + return 0 class Meta: abstract = True