From 3bc1ee583e7ab5046eac2af1035e2d74ccdd05b9 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 5 Aug 2022 20:47:33 +0200 Subject: [PATCH] make carp autoupvote posts in /h/foid --- files/routes/posts.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 225ddcd38..ed41d02df 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -1070,7 +1070,7 @@ def submit_post(v, sub=None): post.upvotes += 1 g.db.add(post) - if SITE == 'rdrama.net' and post.sub and post.sub in ('stupidpol') and v.id not in (SOREN_ID, SCHIZO_ID): + if SITE == 'rdrama.net' and post.sub == 'stupidpol' and v.id not in (SOREN_ID, SCHIZO_ID): g.db.flush() autovote = Vote( user_id=SCHIZO_ID, @@ -1085,6 +1085,21 @@ def submit_post(v, sub=None): post.upvotes += 1 g.db.add(post) + if SITE == 'rdrama.net' and post.sub == 'foid' and v.id != CARP_ID: + g.db.flush() + autovote = Vote( + user_id=CARP_ID, + submission_id=post.id, + vote_type=1 + ) + autovote.created_utc += 1 + g.db.add(autovote) + v.coins += 1 + v.truecoins += 1 + g.db.add(v) + post.upvotes += 1 + g.db.add(post) + cache.delete_memoized(frontlist) cache.delete_memoized(User.userpagelisting)