From bb3dee753391e2257d0a2941e8ae196a535eb5bb Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 20 Jul 2021 13:28:56 +0100 Subject: [PATCH] Getting post content --- utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utils.py b/utils.py index d34634e92..d7c78924d 100644 --- a/utils.py +++ b/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