forked from rDrama/rDrama
do this https://watchpeopledie.tv/h/meta/post/61549/megathread-for-bugs-and-suggestions/2863583#context
parent
facdcf55ce
commit
677b3d9619
|
@ -1022,8 +1022,10 @@ def edit_post(pid, v):
|
||||||
if not v.can_edit(p): abort(403)
|
if not v.can_edit(p): abort(403)
|
||||||
|
|
||||||
# Disable edits on things older than 1wk unless it's a draft or editor is a jannie
|
# Disable edits on things older than 1wk unless it's a draft or editor is a jannie
|
||||||
if time.time() - p.created_utc > 7*24*60*60 and not p.draft and v.admin_level < PERMS["IGNORE_EDITING_LIMIT"] and v.id not in EXEMPT_FROM_EDITING_LIMIT:
|
if SITE_NAME == 'rDrama': days = 7
|
||||||
abort(403, "You can't edit posts older than 7 days!")
|
else: days = 30
|
||||||
|
if time.time() - p.created_utc > days*24*60*60 and not p.draft and v.admin_level < PERMS["IGNORE_EDITING_LIMIT"] and v.id not in EXEMPT_FROM_EDITING_LIMIT:
|
||||||
|
abort(403, f"You can't edit posts older than {days} days!")
|
||||||
|
|
||||||
title = request.values.get("title", "").strip()
|
title = request.values.get("title", "").strip()
|
||||||
if len(title) > POST_TITLE_LENGTH_LIMIT:
|
if len(title) > POST_TITLE_LENGTH_LIMIT:
|
||||||
|
|
Loading…
Reference in New Issue