lawlzposts: don't allow unpin awards

lawlzposts: disable if pins feature flag is off
remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-10-23 12:14:27 -05:00
parent bd0f56fd22
commit 0a9e7b3ef4
2 changed files with 2 additions and 0 deletions

View File

@ -421,6 +421,7 @@ def execute_antispam_comment_check(body, v):
def execute_lawlz_actions(v:User, p:Submission):
if v.id != LAWLZ_ID: return
if SITE_NAME != 'rDrama': return
if not FEATURES['PINS']: return
p.stickied_utc = int(time.time()) + 86400
p.stickied = v.username
p.distinguish_level = 6

View File

@ -233,6 +233,7 @@ def award_thing(v, thing_type, id):
cache.delete_memoized(frontlist)
elif kind == "unpin":
if not thing.stickied_utc: abort(403)
if thing.author_id == LAWLZ_ID and SITE_NAME == 'rDrama': abort(403, "You can't unpin lawlzposts!")
if thing_type == 'comment':
t = thing.stickied_utc - 3600*6