mirror of https://gitlab.com/bashrc2/epicyon
Check types on announce list
parent
e5cafd9d53
commit
e3c022f821
|
|
@ -611,6 +611,8 @@ def undo_announce_collection_entry(recent_posts_cache: {},
|
||||||
return
|
return
|
||||||
if not post_json_object['object'].get('shares'):
|
if not post_json_object['object'].get('shares'):
|
||||||
return
|
return
|
||||||
|
if not isinstance(post_json_object['object']['shares'], dict):
|
||||||
|
return
|
||||||
if not post_json_object['object']['shares'].get('items'):
|
if not post_json_object['object']['shares'].get('items'):
|
||||||
return
|
return
|
||||||
total_items: int = 0
|
total_items: int = 0
|
||||||
|
|
@ -699,8 +701,14 @@ def update_announce_collection(recent_posts_cache: {},
|
||||||
}
|
}
|
||||||
post_json_object['object']['shares'] = announcements_json
|
post_json_object['object']['shares'] = announcements_json
|
||||||
else:
|
else:
|
||||||
if post_json_object['object']['shares'].get('items'):
|
shares_items: list[dict] = []
|
||||||
shares_items = post_json_object['object']['shares']['items']
|
if isinstance(post_json_object['object']['shares'], dict):
|
||||||
|
if post_json_object['object']['shares'].get('items'):
|
||||||
|
if isinstance(post_json_object['object']['shares']['items'],
|
||||||
|
list):
|
||||||
|
shares_items = \
|
||||||
|
post_json_object['object']['shares']['items']
|
||||||
|
if shares_items:
|
||||||
for announce_item in shares_items:
|
for announce_item in shares_items:
|
||||||
if not isinstance(announce_item, dict):
|
if not isinstance(announce_item, dict):
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue