fix: participation display generation should check voteinfo.ActiveTUs

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2022-02-04 16:50:27 -08:00
parent 2f8e2288ad
commit 2c08672f15
No known key found for this signature in database
GPG key ID: F7E46DED420788F3

View file

@ -118,7 +118,7 @@ def render_proposal(request: Request, context: dict, proposal: int,
context["voters"] = voters.all() context["voters"] = voters.all()
total = voteinfo.total_votes() total = voteinfo.total_votes()
participation = (total / voteinfo.ActiveTUs) if total else 0 participation = (total / voteinfo.ActiveTUs) if voteinfo.ActiveTUs else 0
context["participation"] = participation context["participation"] = participation
accepted = (voteinfo.Yes > voteinfo.ActiveTUs / 2) or \ accepted = (voteinfo.Yes > voteinfo.ActiveTUs / 2) or \