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.
remotes/1693045480750635534/spooky-22
Snakes 2022-06-20 07:39:45 -04:00
parent 842022309f
commit e212eb567d
1 changed files with 1 additions and 1 deletions

View File

@ -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)