From d324ba659346d9410f1ba879166464c09f44f408 Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 19 Feb 2024 00:35:54 +0200 Subject: [PATCH] give ppl an error msg when awarding long posts so they dont feel scammed --- files/routes/awards.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index 01c60c4d1e..70414e8d1c 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -170,6 +170,9 @@ def award_thing(v, thing_type, id): award_title = AWARDS[kind]['title'] + if obj.is_longpost and kind in {"ectoplasm", "candycorn", "candycane", "stab", "tilt", "queen", "chud", "marsify", "Furry", "Edgy", "Femboy", "Furry Founder", "Edgy Founder", "Femboy Founder"}: + abort(403, f'Long posts are protected from the {award_title} award!') + award = g.db.query(AwardRelationship).filter( AwardRelationship.kind == kind, AwardRelationship.user_id == v.id, @@ -263,7 +266,7 @@ def award_thing(v, thing_type, id): link = f"[this {thing_type}]({obj.shortlink})" - can_alter_body = not obj.is_longpost and (not obj.author.deflector or v == obj.author) + can_alter_body = not obj.author.deflector or v == obj.author if kind == "ban": link = f"/{thing_type}/{obj.id}" @@ -560,9 +563,6 @@ def award_thing(v, thing_type, id): author.grinch = True if v.id == author.id: session['event_music'] = False - elif kind in {"ectoplasm", "candycorn", "candycane", "stab", "tilt"}: - if obj.is_longpost: - abort(403, f'Long posts are protected from the {award_title} award!') elif kind == "gold": if obj.award_count('glowie', v): abort(409, f"This {thing_type} is under the effect of a conflicting award: Glowie award!")