make carp autoupvote posts in /h/foid

remotes/1693045480750635534/spooky-22
Aevann1 2022-08-05 20:47:33 +02:00
parent a8f62aecdb
commit 3bc1ee583e
1 changed files with 16 additions and 1 deletions

View File

@ -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)