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']
|
thisPostJson = postJsonObject['object']
|
||||||
if not thisPostJson.get('content'):
|
if not thisPostJson.get('content'):
|
||||||
return ''
|
return ''
|
||||||
content = thisPostJson['content']
|
content = ''
|
||||||
if thisPostJson.get('contentMap'):
|
if thisPostJson.get('contentMap'):
|
||||||
if isinstance(thisPostJson['contentMap'], dict):
|
if isinstance(thisPostJson['contentMap'], dict):
|
||||||
if thisPostJson['contentMap'].get(systemLanguage):
|
if thisPostJson['contentMap'].get(systemLanguage):
|
||||||
if isinstance(thisPostJson['contentMap'][systemLanguage], str):
|
if isinstance(thisPostJson['contentMap'][systemLanguage], str):
|
||||||
return thisPostJson['contentMap'][systemLanguage]
|
return thisPostJson['contentMap'][systemLanguage]
|
||||||
if not isinstance(content, str):
|
else:
|
||||||
return ''
|
if isinstance(thisPostJson['content'], str):
|
||||||
|
content = thisPostJson['content']
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue