From 9d221604b4993e4fd07bb73c9ad865c16f42aca4 Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Wed, 5 Jan 2022 20:16:27 -0800 Subject: [PATCH] fix(routers.trusted_user): fix proposal participation percentage Closes #238 Signed-off-by: Kevin Morris --- aurweb/routers/trusted_user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aurweb/routers/trusted_user.py b/aurweb/routers/trusted_user.py index bfc38bf6..0fa3ed28 100644 --- a/aurweb/routers/trusted_user.py +++ b/aurweb/routers/trusted_user.py @@ -125,8 +125,8 @@ def render_proposal(request: Request, context["voteinfo"] = voteinfo context["voters"] = voters.all() - participation = voteinfo.ActiveTUs / voteinfo.total_votes() \ - if voteinfo.total_votes() else 0 + total = voteinfo.total_votes() + participation = (total / voteinfo.ActiveTUs) if total else 0 context["participation"] = participation accepted = (voteinfo.Yes > voteinfo.ActiveTUs / 2) or \