diff --git a/files/helpers/const.py b/files/helpers/const.py index 27a5e9706..7c3b6cba0 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -1244,6 +1244,12 @@ if SITE_NAME == 'PCM': } AWARDS.update(PCM_AWARDS) +# Permit only cosmetics and pin/unpin on ghosted things. +for award in AWARDS: + AWARDS[award]['ghost'] = AWARDS[award]['cosmetic'] +AWARDS['pin']['ghost'] = True +AWARDS['unpin']['ghost'] = True + # Disable unused awards, and site-specific award inclusion/exclusion. AWARDS_DISABLED = [ 'ghost', 'nword', 'lootbox', # Generic @@ -1317,7 +1323,6 @@ if not FEATURES['PROCOINS']: AWARDS_DISABLED.append('benefactor') AWARDS2 = {x: AWARDS[x] for x in AWARDS if x not in AWARDS_DISABLED} -AWARDS3 = {x: AWARDS2[x] for x in AWARDS2 if AWARDS2[x]['price'] <= 500} DOUBLE_XP_ENABLED = -1 # set to unixtime for when DXP begins, -1 to disable diff --git a/files/routes/awards.py b/files/routes/awards.py index b9ce33f31..06b54b483 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -167,6 +167,9 @@ def award_thing(v, thing_type, id): if kind == 'marsify' and author.marsify == 1: abort(403, "User is already permanently marsified!") + if thing.ghost and not AWARDS[kind]['ghost']: + abort(403, "This kind of award can't be used on ghost posts.") + if v.id != author.id: safe_username = "👻" if thing.ghost else f"@{author.username}" @@ -264,7 +267,6 @@ def award_thing(v, thing_type, id): badge_grant(user=author, badge_id=28) elif kind == "flairlock": - if thing.ghost: abort(403) new_name = note[:100].replace("𒐪","") if not new_name and author.flairchanged: author.flairchanged += 86400