From bf64ab19e1ee37e263280e759ddb949428016908 Mon Sep 17 00:00:00 2001 From: eyjhb Date: Mon, 10 Mar 2025 20:03:41 +0100 Subject: [PATCH] notify: ensure that body always ends as a string, when handling json --- machines/gerd/services/notify/app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/machines/gerd/services/notify/app.py b/machines/gerd/services/notify/app.py index ffb7c73..9e55ee8 100644 --- a/machines/gerd/services/notify/app.py +++ b/machines/gerd/services/notify/app.py @@ -265,6 +265,9 @@ def send_notification(): except Exception: return ("Unable to compile JQ, please ensure it is correct", 400) + if not isinstance(body, str): + body = json.dumps(body, indent=4) + con = get_db() cur = con.cursor() res = cur.execute(