#58 Voting UI is bugged when no vote was submitted
This commit is contained in:
@@ -94,7 +94,9 @@ class Place(Submittable, Taggable, Mapable):
|
||||
self.remove_expired_votes()
|
||||
|
||||
if self.placevotings.count() == 0:
|
||||
return 5
|
||||
self.level = 5
|
||||
self.save()
|
||||
return
|
||||
|
||||
level = 0
|
||||
|
||||
@@ -102,6 +104,7 @@ class Place(Submittable, Taggable, Mapable):
|
||||
level += vote.vote
|
||||
|
||||
self.level = floor(level / self.placevotings.count())
|
||||
self.save()
|
||||
|
||||
def remove_expired_votes(self):
|
||||
for vote in self.placevotings.all():
|
||||
|
Reference in New Issue
Block a user