stickies: fix logic error i reintroduced that @Aevann1 has earlier fixed

remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-10-26 18:32:30 -05:00
parent 6a021c4736
commit e4d50be763
1 changed files with 2 additions and 1 deletions

View File

@ -1212,8 +1212,9 @@ def sticky_post(post_id, v):
abort(403, "Can't pin award pins!")
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False).count()
extra_pin_slots = 1 if post.stickied else 0
if pins >= PIN_LIMIT + 1 and v.admin_level < PERMS['BYPASS_PIN_LIMIT']:
if pins >= PIN_LIMIT + extra_pin_slots and v.admin_level < PERMS['BYPASS_PIN_LIMIT']:
abort(403, f"Can't exceed {PIN_LIMIT} pinned posts limit!")
if not post.stickied_utc: