Likes and replies within object

master
Bob Mottram 2019-07-12 13:43:18 +01:00
parent 3b7ac2c18d
commit e33bca287a
1 changed files with 7 additions and 3 deletions

View File

@ -849,10 +849,14 @@ def createBoxBase(baseDir: str,boxname: str, \
# get the post as json # get the post as json
with open(filePath, 'r') as fp: with open(filePath, 'r') as fp:
p=commentjson.load(fp) p=commentjson.load(fp)
# Don't show likes to unauthorized viewers # Don't show likes or replies to unauthorized viewers
if not authorized: if not authorized:
if p.get('likes'): if p.get('object'):
if isinstance(p['object'], dict):
if p['object'].get('likes'):
p['likes']={} p['likes']={}
if p['object'].get('replies'):
p['replies']={}
# insert it into the box feed # insert it into the box feed
if postsOnPageCtr < itemsPerPage: if postsOnPageCtr < itemsPerPage:
if not headerOnly: if not headerOnly: