#298 fix problem with a votecast of 0, -1 and -2

This commit is contained in:
Oskar Hahn 2012-07-16 14:10:56 +02:00
parent 07c4649243
commit 4e5884bda4

View File

@ -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