From e4a9db57ce899ece48d27a98be8fb099b6aae33b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 18 May 2020 17:21:10 +0100 Subject: [PATCH] Don't remove replies to blog posts, including attachments --- utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/utils.py b/utils.py index 201f240c8..133b57cf4 100644 --- a/utils.py +++ b/utils.py @@ -440,6 +440,11 @@ def deletePost(baseDir: str, httpPrefix: str, if bookmarkIndex in open(bookmarksIndexFilename).read(): return + # don't remove replies to blog posts + if isReplyToBlogPost(baseDir, nickname, domain, + postJsonObject): + return + # remove any attachment removeAttachment(baseDir, httpPrefix, domain, postJsonObject) @@ -453,9 +458,7 @@ def deletePost(baseDir: str, httpPrefix: str, getCachedPostFilename(baseDir, nickname, domain, postJsonObject) if cachedPostFilename: if os.path.isfile(cachedPostFilename): - if not isReplyToBlogPost(baseDir, nickname, domain, - postJsonObject): - os.remove(cachedPostFilename) + os.remove(cachedPostFilename) # removePostFromCache(postJsonObject,recentPostsCache) hasObject = False