From 3e666a4a91253e84b916c653efb5647d6c6382aa Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 6 Oct 2020 13:33:53 +0100 Subject: [PATCH] Moderated posts can be rejected --- newswire.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/newswire.py b/newswire.py index 19d62fb1..38090080 100644 --- a/newswire.py +++ b/newswire.py @@ -238,20 +238,22 @@ def updateNewswireModerationQueue(baseDir: str, handle: str, # if the post is still in the moderation queue if '[accepted]' not in \ open(moderationStatusFilename).read(): - - # load the post and add its details to the moderation queue - postJsonObject = None - if fullPostFilename: - postJsonObject = loadJson(fullPostFilename) - if isaBlogPost(postJsonObject): - published = postJsonObject['object']['published'] - published = published.replace('T', ' ') - published = published.replace('Z', '+00:00') - moderationDict[published] = \ - [postJsonObject['object']['summary'], - postJsonObject['object']['url'], - nickname, moderationStatusStr, - fullPostFilename] + if '[rejected]' not in \ + open(moderationStatusFilename).read(): + # load the post and add its details to the + # moderation queue + postJsonObject = None + if fullPostFilename: + postJsonObject = loadJson(fullPostFilename) + if isaBlogPost(postJsonObject): + published = postJsonObject['object']['published'] + published = published.replace('T', ' ') + published = published.replace('Z', '+00:00') + moderationDict[published] = \ + [postJsonObject['object']['summary'], + postJsonObject['object']['url'], + nickname, moderationStatusStr, + fullPostFilename] ctr += 1 if ctr >= maxBlogsPerAccount: