forked from rDrama/rDrama
1
0
Fork 0
Aevann 2024-03-05 00:51:26 +02:00
parent facdcf55ce
commit 677b3d9619
1 changed files with 4 additions and 2 deletions

View File

@ -1022,8 +1022,10 @@ def edit_post(pid, v):
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
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:
abort(403, "You can't edit posts older than 7 days!")
if SITE_NAME == 'rDrama': days = 7
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()
if len(title) > POST_TITLE_LENGTH_LIMIT: