From e212eb567d276321334417d0f707f4ef5ee6e90d Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 20 Jun 2022 07:39:45 -0400 Subject: [PATCH] Exclude comments on drafts from edit limit. Draft posts have already been excluded from the edit time limit for obvious reasons--drafts are intended to be edited, and people use them as personal megathreads on their profiles. Largely for the latter use case, this commit also excludes comments on drafts from the limit. --- files/routes/comments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 4edf58eaf..64dfd0bb8 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -654,7 +654,7 @@ def edit_comment(cid, v): c = get_comment(cid, v=v) - if time.time() - c.created_utc > 7*24*60*60: + if time.time() - c.created_utc > 7*24*60*60 and not (c.post and c.post.private): return {"error":"You can't edit comments older than 1 week!"}, 403 if c.author_id != v.id: abort(403)