diff --git a/files/routes/awards.py b/files/routes/awards.py index c7bb7e2c11..81e5501b0d 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -413,11 +413,11 @@ def award_post(pid, v): elif kind == "rehab": if author.rehab: author.rehab += 86400 else: author.rehab = int(time.time()) + 86400 - if not v.has_badge(109): - badge = Badge(user_id=v.id, badge_id=109) + if not author.has_badge(109): + badge = Badge(user_id=author.id, badge_id=109) g.db.add(badge) g.db.flush() - send_notification(v.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}") + send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}") if post.author.received_award_count: post.author.received_award_count += 1 else: post.author.received_award_count = 1 @@ -647,11 +647,11 @@ def award_comment(cid, v): elif kind == "rehab": if author.rehab: author.rehab += 86400 else: author.rehab = int(time.time()) + 86400 - if not v.has_badge(109): - badge = Badge(user_id=v.id, badge_id=109) + if not author.has_badge(109): + badge = Badge(user_id=author.id, badge_id=109) g.db.add(badge) g.db.flush() - send_notification(v.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}") + send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}") if c.author.received_award_count: c.author.received_award_count += 1 else: c.author.received_award_count = 1 diff --git a/files/routes/posts.py b/files/routes/posts.py index 71563edae4..efc962bcb9 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -700,7 +700,7 @@ def thumbnail_thread(pid): db.add(post) db.commit() - if SITE == 'rdrama.net' and random.random() < 0.02: + if SITE == 'rdrama.net' and random.random() < 0.01: for t in ("submission","comment"): for term in ('rdrama','freeghettohoes.biz','marsey'): for i in requests.get(f'https://api.pushshift.io/reddit/{t}/search?html_decode=true&q={term}&size=10').json()["data"]: