change editing comments limit from a month to a week

master
Aevann 2024-02-25 01:43:38 +02:00
parent ce216f7f37
commit 5cfc89db80
3 changed files with 6 additions and 8 deletions

View File

@ -182,7 +182,7 @@ PERMS = { # Minimum admin_level to perform action.
'USER_CHANGE_FLAIR': 2,
'LOTTERY_VIEW_PARTICIPANTS': 2,
'POST_COMMENT_INFINITE_PINGS': 2,
'IGNORE_1MONTH_EDITING_LIMIT': 2,
'IGNORE_EDITING_LIMIT': 2,
'ORGIES': 2,
'POST_BETS': 2,
'POST_BETS_DISTRIBUTE': 2,
@ -574,7 +574,7 @@ GTIX_ID = 0
CURRENCY_TRANSFER_ID = 5
IMMUNE_TO_NEGATIVE_AWARDS = {}
EXEMPT_FROM_1MONTH_EDITING_LIMIT = {}
EXEMPT_FROM_EDITING_LIMIT = {}
PINNED_POSTS_IDS = {}
MODMAIL_ID = 2
@ -674,7 +674,7 @@ if SITE in {'rdrama.net', 'staging.rdrama.net'}:
BOT_SYMBOL_HIDDEN = {12125, 16049, 23576}
ANTISPAM_BYPASS_IDS = BOT_SYMBOL_HIDDEN | {1703, 13427, 15014, 24197, 25816}
EXEMPT_FROM_1MONTH_EDITING_LIMIT = {1048}
EXEMPT_FROM_EDITING_LIMIT = {1048}
AUTOJANNY_ID = 1046
SNAPPY_ID = 261

View File

@ -590,9 +590,8 @@ def toggle_comment_nsfw(cid, v):
def edit_comment(cid, v):
c = get_comment(cid, v=v)
if time.time() - c.created_utc > 31*24*60*60 and not (c.post and c.post.draft) \
and v.admin_level < PERMS["IGNORE_1MONTH_EDITING_LIMIT"] and v.id not in EXEMPT_FROM_1MONTH_EDITING_LIMIT:
abort(403, "You can't edit comments older than 1 month!")
if time.time() - c.created_utc > 7*24*60*60 and not (c.post and c.post.draft) and v.admin_level < PERMS["IGNORE_EDITING_LIMIT"] and v.id not in EXEMPT_FROM_EDITING_LIMIT:
abort(403, "You can't edit comments older than 1 week!")
if c.author_id != v.id and v.admin_level < PERMS['POST_COMMENT_EDITING']:
abort(403)

View File

@ -1030,8 +1030,7 @@ 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 > 31*24*60*60 and not p.draft \
and v.admin_level < PERMS["IGNORE_1MONTH_EDITING_LIMIT"] and v.id not in EXEMPT_FROM_1MONTH_EDITING_LIMIT:
if time.time() - p.created_utc > 31*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 1 month!")
title = request.values.get("title", "").strip()