master
Aevann1 2021-09-02 21:24:50 +02:00
parent e31ed9d108
commit daf915a522
2 changed files with 6 additions and 2 deletions

View File

@ -186,9 +186,11 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
if random.random() < 0.004:
for post in posts:
if post.author and post.author.shadowbanned:
rand = random.randint(5,20)
if post.score > rand: continue
rand = random.randint(500,1400)
vote = Vote(user_id=rand,
vote_type=random.choice([-1, 1]),
vote_type=random.choice([-1, 1, 1, 1, 1]),
submission_id=post.id)
g.db.add(vote)
try: g.db.flush()

View File

@ -166,9 +166,11 @@ def post_id(pid, anything=None, v=None):
if random.random() < 0.02:
for comment in comments:
if comment.author and comment.author.shadowbanned:
rand = random.randint(5,20)
if comment.score > rand: continue
rand = random.randint(500,1400)
vote = CommentVote(user_id=rand,
vote_type=random.choice([-1, 1]),
vote_type=random.choice([-1, 1, 1, 1, 1]),
comment_id=comment.id)
g.db.add(vote)
try: g.db.flush()