From 84d428a9ea7d32a84e305b9ec56b4f36bd3d7d75 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 13 Sep 2021 20:54:43 +0200 Subject: [PATCH] fd --- files/routes/admin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/routes/admin.py b/files/routes/admin.py index 2b961ef062..2ab8039bd5 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -30,6 +30,8 @@ def refund(v): for u in g.db.query(User).all(): posts = g.db.query(func.sum(Submission.upvotes + Submission.downvotes - 1)).options(lazyload('*')).filter_by(author_id = u.id, is_banned = False, deleted_utc = 0).scalar() comments = g.db.query(func.sum(Comment.upvotes + Comment.downvotes - 1)).options(lazyload('*')).filter_by(author_id = u.id, is_banned = False, deleted_utc = 0).scalar() + if not posts: posts = 0 + if not comments: comments = 0 u.truecoins = posts+comments g.db.add(u) return "sex"