From 17c3fe9e4c4e11900925c1ed328740ab942a215a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 19 Jun 2022 19:45:48 +0200 Subject: [PATCH] make me auto-upvote all posts in holes --- files/routes/posts.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/files/routes/posts.py b/files/routes/posts.py index bc0c72ef0..825e3ceda 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -1265,6 +1265,15 @@ def submit_post(v, sub=None): post.upvotes += 3 g.db.add(post) + if post.sub: + autovote = Vote(user_id=AEVANN_ID, submission_id=post.id, vote_type=1) + g.db.add(autovote) + v.coins += 1 + v.truecoins += 1 + g.db.add(v) + post.upvotes += 1 + g.db.add(post) + g.db.commit() cache.delete_memoized(frontlist)