From 91d77259979ccc4f034afe015f7eb950d5787a56 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 22 Jun 2022 18:28:59 +0200 Subject: [PATCH] make me autoupvote posts in slackernews --- files/routes/posts.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/files/routes/posts.py b/files/routes/posts.py index bc0c72ef0..5879c8042 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -1265,6 +1265,16 @@ def submit_post(v, sub=None): post.upvotes += 3 g.db.add(post) + if request.host == 'rdrama.net' and post.sub == 'slackernews' and v.id != AEVANN_ID: + g.db.commit() + 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)