From bee236a44fd2c33348d5026168c3e766b277025a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 6 Oct 2020 14:05:15 +0100 Subject: [PATCH] Check that post is located --- newswire.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/newswire.py b/newswire.py index 194d8220..1a59c0bf 100644 --- a/newswire.py +++ b/newswire.py @@ -219,6 +219,12 @@ def updateNewswireModerationQueue(baseDir: str, handle: str, fullPostFilename = \ locatePost(baseDir, nickname, domain, postUrl, False) + if not fullPostFilename: + print('Unable to locate post ' + postUrl) + ctr += 1 + if ctr >= maxBlogsPerAccount: + break + moderationStatusFilename = fullPostFilename + '.moderate' moderationStatusStr = '' if not os.path.isfile(moderationStatusFilename): @@ -289,6 +295,12 @@ def addAccountBlogsToNewswire(baseDir: str, nickname: str, domain: str, fullPostFilename = \ locatePost(baseDir, nickname, domain, postUrl, False) + if not fullPostFilename: + print('Unable to locate post ' + postUrl) + ctr += 1 + if ctr >= maxBlogsPerAccount: + break + postJsonObject = None if fullPostFilename: postJsonObject = loadJson(fullPostFilename)