Don't save to cache for public only posts

main2
Bob Mottram 2019-10-19 11:35:45 +01:00
parent 966baef1cd
commit b3e205c7c2
1 changed files with 10 additions and 8 deletions

View File

@ -2115,14 +2115,16 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
else:
postStr=galleryStr
# save to posts cache on file
if not os.path.isdir(htmlPostCacheDir):
os.mkdir(htmlPostCacheDir)
try:
with open(cachedPostFilename, 'w') as fp:
fp.write(postStr)
except Exception as e:
print('ERROR: saving post to cache '+str(e))
if not showPublicOnly:
# save to posts cache on file
if not os.path.isdir(htmlPostCacheDir):
os.mkdir(htmlPostCacheDir)
try:
with open(cachedPostFilename, 'w') as fp:
fp.write(postStr)
except Exception as e:
print('ERROR: saving post to cache '+str(e))
return postStr