diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index db8507d34..395a60da8 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -359,7 +359,7 @@ PERMS = { # Minimum admin_level to perform action. 'USER_CHANGE_FLAIR': 2, 'LOTTERY_VIEW_PARTICIPANTS': 2, 'POST_COMMENT_INFINITE_PINGS': 2, - 'IGNORE_1WEEk_EDITING_LIMIT': 2, + 'IGNORE_1MONTH_EDITING_LIMIT': 2, 'ORGIES': 2, 'POST_BETS': 2, 'POST_BETS_DISTRIBUTE': 2, @@ -543,7 +543,7 @@ GTIX_ID = 0 LAWLZ_ID = 0 IMMUNE_TO_NEGATIVE_AWARDS = {} -EXEMPT_FROM_1WEEK_EDITING_LIMIT = {} +EXEMPT_FROM_1MONTH_EDITING_LIMIT = {} MODMAIL_ID = 2 GIFT_NOTIF_ID = 5 @@ -639,7 +639,7 @@ if SITE in {'rdrama.net', 'staging.rdrama.net'}: BOT_SYMBOL_HIDDEN = {12125,16049,23576} ANTISPAM_BYPASS_IDS = BOT_SYMBOL_HIDDEN | {1703, 13427, 15014} - EXEMPT_FROM_1WEEK_EDITING_LIMIT = {1048} + EXEMPT_FROM_1MONTH_EDITING_LIMIT = {1048} AUTOJANNY_ID = 1046 SNAPPY_ID = 261 diff --git a/files/routes/comments.py b/files/routes/comments.py index fbb4fac68..a5d1eaee0 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -645,9 +645,9 @@ def toggle_comment_nsfw(cid, v): def edit_comment(cid, v): c = get_comment(cid, v=v) - if time.time() - c.created_utc > 7*24*60*60 and not (c.post and c.post.private) \ - and v.admin_level < PERMS["IGNORE_1WEEk_EDITING_LIMIT"] and v.id not in EXEMPT_FROM_1WEEK_EDITING_LIMIT: - abort(403, "You can't edit comments older than 1 week!") + if time.time() - c.created_utc > 31*24*60*60 and not (c.post and c.post.private) \ + 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 c.author_id != v.id and v.admin_level < PERMS['POST_COMMENT_EDITING']: abort(403) diff --git a/files/routes/posts.py b/files/routes/posts.py index ac75434a0..6356c4667 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -981,9 +981,9 @@ 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.private \ - and v.admin_level < PERMS["IGNORE_1WEEk_EDITING_LIMIT"] and v.id not in EXEMPT_FROM_1WEEK_EDITING_LIMIT: - abort(403, "You can't edit posts older than 1 week!") + if time.time() - p.created_utc > 31*24*60*60 and not p.private \ + 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 posts older than 1 month!") title = request.values.get("title", "") title = title[:POST_TITLE_LENGTH_LIMIT].strip()