Exclude JL3 from edit_post limit (megathreads &c).

remotes/1693045480750635534/spooky-22
Snakes 2022-06-18 18:24:59 -04:00
parent 193615a441
commit 27b6055d6e
1 changed files with 5 additions and 4 deletions

View File

@ -440,10 +440,11 @@ def morecomments(v, cid):
def edit_post(pid, v):
p = get_post(pid)
if time.time() - p.created_utc > 7*24*60*60:
return {"error":"You can't edit posts older than 1 week!"}, 403
if p.author_id != v.id and not (v.admin_level > 1 and v.admin_level > 2): abort(403)
if not v.admin_level >= 3:
if time.time() - p.created_utc > 7*24*60*60:
return {"error":"You can't edit posts older than 1 week!"}, 403
elif p.author_id != v.id:
abort(403)
title = request.values.get("title", "").strip().replace('','')