Create items

master
Bob Mottram 2019-08-20 21:23:35 +01:00
parent cf8aacf176
commit e0d9715629
1 changed files with 3 additions and 0 deletions

View File

@ -70,6 +70,9 @@ def likedByPerson(postJsonObject: {}, nickname: str,domain: str) -> bool:
return False return False
if not postJsonObject['object'].get('likes'): if not postJsonObject['object'].get('likes'):
return False return False
if not postJsonObject['object']['likes'].get('items'):
postJsonObject['object']['likes']['items']=[]
postJsonObject['object']['likes']['totalItems']=0
actorMatch=domain+'/users/'+nickname actorMatch=domain+'/users/'+nickname
for item in postJsonObject['object']['likes']['items']: for item in postJsonObject['object']['likes']['items']:
if item['actor'].endswith(actorMatch): if item['actor'].endswith(actorMatch):