diff --git a/files/routes/comments.py b/files/routes/comments.py index a5d10d296..0c7b59f9e 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -637,12 +637,13 @@ def edit_comment(cid, v): if c.author.hieroglyphs and marseyaward_body_regex.search(body_html): abort(403, "You can only type marseys!") - edit_log = CommentEdit( - comment_id=c.id, - old_body=c.body, - old_body_html=c.body_html, - ) - g.db.add(edit_log) + if int(time.time()) - c.created_utc > 60 * 3: + edit_log = CommentEdit( + comment_id=c.id, + old_body=c.body, + old_body_html=c.body_html, + ) + g.db.add(edit_log) oldtext = c.body diff --git a/files/routes/posts.py b/files/routes/posts.py index 6bfadf6b0..6d3727d58 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -1057,14 +1057,15 @@ def edit_post(pid, v): changed = False - edit_log = PostEdit( - post_id=p.id, - old_title=p.title, - old_title_html=p.title_html, - old_body=p.body, - old_body_html=p.body_html, - ) - g.db.add(edit_log) + if int(time.time()) - p.created_utc > 60 * 3: + edit_log = PostEdit( + post_id=p.id, + old_title=p.title, + old_title_html=p.title_html, + old_body=p.body, + old_body_html=p.body_html, + ) + g.db.add(edit_log) if title != p.title: title_html = filter_emojis_only(title, golden=False, obj=p, author=p.author)