mirror of https://gitlab.com/bashrc2/epicyon
Handle non-compliant wordpress contentMap
parent
03735ea75d
commit
8b22e91b11
12
utils.py
12
utils.py
|
@ -249,13 +249,15 @@ def get_content_from_post(post_json_object: {}, system_language: str,
|
||||||
if has_object_dict(post_json_object):
|
if has_object_dict(post_json_object):
|
||||||
this_post_json = post_json_object['object']
|
this_post_json = post_json_object['object']
|
||||||
map_dict = content_type + 'Map'
|
map_dict = content_type + 'Map'
|
||||||
if not this_post_json.get(content_type) and \
|
has_contentmap_dict = False
|
||||||
not this_post_json.get(map_dict):
|
|
||||||
return ''
|
|
||||||
content = ''
|
|
||||||
map_dict = content_type + 'Map'
|
|
||||||
if this_post_json.get(map_dict):
|
if this_post_json.get(map_dict):
|
||||||
if isinstance(this_post_json[map_dict], dict):
|
if isinstance(this_post_json[map_dict], dict):
|
||||||
|
has_contentmap_dict = True
|
||||||
|
if not this_post_json.get(content_type) and \
|
||||||
|
not has_contentmap_dict:
|
||||||
|
return ''
|
||||||
|
content = ''
|
||||||
|
if has_contentmap_dict:
|
||||||
if this_post_json[map_dict].get(system_language):
|
if this_post_json[map_dict].get(system_language):
|
||||||
sys_lang = this_post_json[map_dict][system_language]
|
sys_lang = this_post_json[map_dict][system_language]
|
||||||
if isinstance(sys_lang, str):
|
if isinstance(sys_lang, str):
|
||||||
|
|
Loading…
Reference in New Issue