mirror of https://gitlab.com/bashrc2/epicyon
Getting post content
parent
67670da87a
commit
bb3dee7533
7
utils.py
7
utils.py
|
@ -37,14 +37,15 @@ def getContentFromPost(postJsonObject: {}, systemLanguage: str) -> str:
|
|||
thisPostJson = postJsonObject['object']
|
||||
if not thisPostJson.get('content'):
|
||||
return ''
|
||||
content = thisPostJson['content']
|
||||
content = ''
|
||||
if thisPostJson.get('contentMap'):
|
||||
if isinstance(thisPostJson['contentMap'], dict):
|
||||
if thisPostJson['contentMap'].get(systemLanguage):
|
||||
if isinstance(thisPostJson['contentMap'][systemLanguage], str):
|
||||
return thisPostJson['contentMap'][systemLanguage]
|
||||
if not isinstance(content, str):
|
||||
return ''
|
||||
else:
|
||||
if isinstance(thisPostJson['content'], str):
|
||||
content = thisPostJson['content']
|
||||
return content
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue