Check that json was returned

main
Bob Mottram 2021-09-03 13:51:46 +01:00
parent 192018cde6
commit e036cc15de
1 changed files with 58 additions and 52 deletions

110
daemon.py
View File

@ -7146,32 +7146,35 @@ class PubServer(BaseHTTPRequestHandler):
print('Regenerating html post for changed likes collection') print('Regenerating html post for changed likes collection')
pageNumber = 1 pageNumber = 1
likedPostJson = loadJson(likedPostFilename, 0, 1) likedPostJson = loadJson(likedPostFilename, 0, 1)
showIndividualPostIcons = True if likedPostJson:
manuallyApproveFollowers = \ showIndividualPostIcons = True
followerApprovalActive(baseDir, self.postToNickname, domain) manuallyApproveFollowers = \
individualPostAsHtml(self.server.signingPrivateKeyPem, True, followerApprovalActive(baseDir,
self.server.recentPostsCache, self.postToNickname, domain)
self.server.maxRecentPosts, individualPostAsHtml(self.server.signingPrivateKeyPem, True,
self.server.translate, self.server.recentPostsCache,
pageNumber, baseDir, self.server.maxRecentPosts,
self.server.session, self.server.translate,
self.server.cachedWebfingers, pageNumber, baseDir,
self.server.personCache, self.server.session,
self.postToNickname, domain, self.server.cachedWebfingers,
self.server.port, likedPostJson, None, True, self.server.personCache,
self.server.allowDeletion, self.postToNickname, domain,
httpPrefix, __version__, 'inbox', self.server.port, likedPostJson,
self.server.YTReplacementDomain, None, True,
self.server.showPublishedDateOnly, self.server.allowDeletion,
self.server.peertubeInstances, httpPrefix, __version__, 'inbox',
self.server.allowLocalNetworkAccess, self.server.YTReplacementDomain,
self.server.themeName, self.server.showPublishedDateOnly,
self.server.systemLanguage, self.server.peertubeInstances,
self.server.maxLikeCount, self.server.allowLocalNetworkAccess,
not isDM(likedPostJson), self.server.themeName,
showIndividualPostIcons, self.server.systemLanguage,
manuallyApproveFollowers, self.server.maxLikeCount,
False, True, False) not isDM(likedPostJson),
showIndividualPostIcons,
manuallyApproveFollowers,
False, True, False)
# clear the icon from the cache so that it gets updated # clear the icon from the cache so that it gets updated
if self.server.iconsCache.get('like.png'): if self.server.iconsCache.get('like.png'):
@ -7280,32 +7283,35 @@ class PubServer(BaseHTTPRequestHandler):
print('Regenerating html post for changed likes collection') print('Regenerating html post for changed likes collection')
pageNumber = 1 pageNumber = 1
likedPostJson = loadJson(likedPostFilename, 0, 1) likedPostJson = loadJson(likedPostFilename, 0, 1)
showIndividualPostIcons = True if likedPostJson:
manuallyApproveFollowers = \ showIndividualPostIcons = True
followerApprovalActive(baseDir, self.postToNickname, domain) manuallyApproveFollowers = \
individualPostAsHtml(self.server.signingPrivateKeyPem, True, followerApprovalActive(baseDir,
self.server.recentPostsCache, self.postToNickname, domain)
self.server.maxRecentPosts, individualPostAsHtml(self.server.signingPrivateKeyPem, True,
self.server.translate, self.server.recentPostsCache,
pageNumber, baseDir, self.server.maxRecentPosts,
self.server.session, self.server.translate,
self.server.cachedWebfingers, pageNumber, baseDir,
self.server.personCache, self.server.session,
self.postToNickname, domain, self.server.cachedWebfingers,
self.server.port, likedPostJson, None, True, self.server.personCache,
self.server.allowDeletion, self.postToNickname, domain,
httpPrefix, __version__, 'inbox', self.server.port, likedPostJson,
self.server.YTReplacementDomain, None, True,
self.server.showPublishedDateOnly, self.server.allowDeletion,
self.server.peertubeInstances, httpPrefix, __version__, 'inbox',
self.server.allowLocalNetworkAccess, self.server.YTReplacementDomain,
self.server.themeName, self.server.showPublishedDateOnly,
self.server.systemLanguage, self.server.peertubeInstances,
self.server.maxLikeCount, self.server.allowLocalNetworkAccess,
not isDM(likedPostJson), self.server.themeName,
showIndividualPostIcons, self.server.systemLanguage,
manuallyApproveFollowers, self.server.maxLikeCount,
False, True, False) not isDM(likedPostJson),
showIndividualPostIcons,
manuallyApproveFollowers,
False, True, False)
# send out the undo like to followers # send out the undo like to followers
self._postToOutbox(undoLikeJson, self.server.projectVersion, None) self._postToOutbox(undoLikeJson, self.server.projectVersion, None)
self.server.GETbusy = False self.server.GETbusy = False