protect effortposts from the rainbow award

pull/216/head
Aevann 2023-10-15 16:55:03 +03:00
parent f6f254307f
commit c84f6895cb
2 changed files with 3 additions and 2 deletions

View File

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

View File

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