forked from indymedia/epicyon
Extra checks on likes
parent
83c10b5906
commit
69c14dd7bf
4
like.py
4
like.py
|
@ -37,6 +37,8 @@ def undoLikesCollectionEntry(postFilename: str,objectUrl: str,actor: str,debug:
|
|||
return
|
||||
if not postJsonObject['object'].get('likes'):
|
||||
return
|
||||
if not isinstance(postJsonObject['object']['likes'], dict):
|
||||
return
|
||||
if not postJsonObject['object']['likes'].get('items'):
|
||||
return
|
||||
totalItems=0
|
||||
|
@ -81,6 +83,8 @@ def noOfLikes(postJsonObject: {}) -> int:
|
|||
return 0
|
||||
if not postJsonObject['object'].get('likes'):
|
||||
return 0
|
||||
if not isinstance(postJsonObject['object']['likes'], dict):
|
||||
return 0
|
||||
if not postJsonObject['object']['likes'].get('items'):
|
||||
postJsonObject['object']['likes']['items']=[]
|
||||
postJsonObject['object']['likes']['totalItems']=0
|
||||
|
|
Loading…
Reference in New Issue