#298 fix problem with a votecast of 0, -1 and -2
This commit is contained in:
parent
07c4649243
commit
4e5884bda4
@ -82,9 +82,8 @@ 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
|
||||
|
||||
class Meta:
|
||||
|
Loading…
Reference in New Issue
Block a user