Moderated posts can be rejected

main
Bob Mottram 2020-10-06 13:33:53 +01:00
parent d0085e1c33
commit 3e666a4a91
1 changed files with 16 additions and 14 deletions

View File

@ -238,20 +238,22 @@ def updateNewswireModerationQueue(baseDir: str, handle: str,
# if the post is still in the moderation queue # if the post is still in the moderation queue
if '[accepted]' not in \ if '[accepted]' not in \
open(moderationStatusFilename).read(): open(moderationStatusFilename).read():
if '[rejected]' not in \
# load the post and add its details to the moderation queue open(moderationStatusFilename).read():
postJsonObject = None # load the post and add its details to the
if fullPostFilename: # moderation queue
postJsonObject = loadJson(fullPostFilename) postJsonObject = None
if isaBlogPost(postJsonObject): if fullPostFilename:
published = postJsonObject['object']['published'] postJsonObject = loadJson(fullPostFilename)
published = published.replace('T', ' ') if isaBlogPost(postJsonObject):
published = published.replace('Z', '+00:00') published = postJsonObject['object']['published']
moderationDict[published] = \ published = published.replace('T', ' ')
[postJsonObject['object']['summary'], published = published.replace('Z', '+00:00')
postJsonObject['object']['url'], moderationDict[published] = \
nickname, moderationStatusStr, [postJsonObject['object']['summary'],
fullPostFilename] postJsonObject['object']['url'],
nickname, moderationStatusStr,
fullPostFilename]
ctr += 1 ctr += 1
if ctr >= maxBlogsPerAccount: if ctr >= maxBlogsPerAccount: