forked from rDrama/rDrama
1
0
Fork 0

make me autoupvote posts in slackernews

master
Aevann1 2022-06-22 18:28:59 +02:00
parent 9ecca715fd
commit 91d7725997
1 changed files with 10 additions and 0 deletions

View File

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