From c84f6895cb42c4495c1c4b8d8636af3b5b6407f5 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 15 Oct 2023 16:55:03 +0300 Subject: [PATCH] protect effortposts from the rainbow award --- files/routes/awards.py | 3 ++- files/routes/posts.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index bc2de9e8cd..bc46a014d6 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -520,7 +520,8 @@ def award_thing(v, thing_type, id): if author.rainbow: author.rainbow += 86400 else: author.rainbow = int(time.time()) + 86400 badge_grant(user=author, badge_id=171) - thing.rainbowed = True + if can_alter_body: + thing.rainbowed = True elif kind == "emoji": award.note = award.note.strip(":").lower() emoji = g.db.query(Emoji).filter_by(name=award.note).one_or_none() diff --git a/files/routes/posts.py b/files/routes/posts.py index 04103104a5..07f9718ea4 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -564,12 +564,12 @@ def submit_post(v, hole=None): title=title, hole=hole, ghost=flag_ghost, - rainbowed=bool(v.rainbow), ) p.chudded = v.chud and hole != 'chudrama' and not (p.is_effortpost and not v.chudded_by) p.queened = v.queen and not p.is_effortpost p.sharpened = v.sharpen and not p.is_effortpost + p.rainbowed = v.rainbow and not p.is_effortpost title_html = filter_emojis_only(title, count_emojis=True, obj=p, author=v)