forked from MarseyWorld/MarseyWorld
made it not possible to edit posts/comments older than a week
parent
eba4452d79
commit
668cfdc90a
|
@ -654,6 +654,9 @@ def edit_comment(cid, v):
|
|||
|
||||
c = get_comment(cid, v=v)
|
||||
|
||||
if time.time() - c.created_utc > 7*24*60*60:
|
||||
return {"error":"You can't edit comments older than 1 week!"}, 403
|
||||
|
||||
if c.author_id != v.id: abort(403)
|
||||
|
||||
body = request.values.get("body", "").strip()[:10000]
|
||||
|
|
|
@ -440,6 +440,9 @@ 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)
|
||||
|
||||
title = request.values.get("title", "").strip().replace('','')
|
||||
|
|
Loading…
Reference in New Issue