From 25f10ea617b90b2f7572aeaf926ed813c0fd2e5d Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Tue, 21 Nov 2023 06:28:02 -0800 Subject: [PATCH] Fix JSON parsing in discourse Signed-off-by: Abhijeet Kasurde --- meetings/backends/ansible/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/meetings/backends/ansible/__init__.py b/meetings/backends/ansible/__init__.py index 397c2a2..b9ce2e1 100644 --- a/meetings/backends/ansible/__init__.py +++ b/meetings/backends/ansible/__init__.py @@ -95,13 +95,11 @@ async def post_to_discourse(config, raw_post, title, logger): payload = {"title": title, "raw": raw_post, "category": config["category_id"]} res = requests.post(url, headers=headers, data=payload) # noqa: S113 - r = json.loads(res.content) logger.info(f"Discourse POST: {res.status_code}") if res.status_code == 200: r = json.loads(res.content) return r["topic_id"] - else: - return "" + return "" # required backend methods