Check object is dict

main
bashrc 2026-08-23 23:41:09 +01:00
parent acadb191b8
commit 88501572de
1 changed files with 5 additions and 4 deletions

View File

@ -513,10 +513,11 @@ def _store_content_labels_base(base_dir: str, nickname: str, domain: str,
# get geolocations from content # get geolocations from content
map_links: list[str] = [] map_links: list[str] = []
published = None published = None
if 'content' in post_json_object['object']: if has_object_dict(post_json_object):
published = post_json_object['object']['published'] if 'content' in post_json_object['object']:
post_content = post_json_object['object']['content'] published = post_json_object['object']['published']
map_links += get_map_links_from_post_content(post_content, session) post_content = post_json_object['object']['content']
map_links += get_map_links_from_post_content(post_content, session)
# get geolocation from labels # get geolocation from labels
location_str = get_location_from_post(post_json_object) location_str = get_location_from_post(post_json_object)
if location_str: if location_str: