#288 fix type error if a poll has no votecast
This commit is contained in:
parent
e4250b6ba1
commit
a1152af7ea
@ -82,7 +82,10 @@ class CountVotesCast(models.Model):
|
|||||||
return print_value(self.votescast)
|
return print_value(self.votescast)
|
||||||
|
|
||||||
def percent_base(self):
|
def percent_base(self):
|
||||||
return 100 / float(self.votescast)
|
try:
|
||||||
|
return 100 / float(self.votescast)
|
||||||
|
except TypeError:
|
||||||
|
return 0
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
abstract = True
|
abstract = True
|
||||||
|
Loading…
Reference in New Issue
Block a user