From a3f94a77f3edfeb9d4c34cb1635ea56443c850b1 Mon Sep 17 00:00:00 2001 From: TLSM Date: Thu, 7 Jul 2022 19:53:28 -0400 Subject: [PATCH] Fix comment /votes/ 500 when no upvoters. --- files/routes/votes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/votes.py b/files/routes/votes.py index dbaa9bb715..232b2f0e43 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -38,7 +38,7 @@ def vote_info_get(v, link): if v.admin_level: up_ids = [x[0] for x in g.db.query(CommentVote.user_id).filter_by(comment_id=thing_id, vote_type=1).order_by(CommentVote.created_utc).all()] total_ups = g.db.query(func.sum(User.truecoins)).filter(User.id.in_(up_ids)).scalar() - total_ups = format(total_ups, ",") + total_ups = format(total_ups, ",") if total_ups else '0' patrons_ups = g.db.query(User).filter(User.id.in_(up_ids), User.patron > 0).count() return render_template("votes.html",