From 479f0612611f0596bdd2b33edbc130ea236e862e Mon Sep 17 00:00:00 2001 From: Viktor van Wijk Date: Thu, 30 Jan 2025 16:39:37 +0100 Subject: [PATCH] :bug: [#5012] Fix handling of response after post request in JSON dump If there is no content (in case of an HTTP 204 response for example), converting the response to json results in an error, so we just return an empty string --- src/openforms/registrations/contrib/json_dump/plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/openforms/registrations/contrib/json_dump/plugin.py b/src/openforms/registrations/contrib/json_dump/plugin.py index 41b8be1c95..6c20b6afce 100644 --- a/src/openforms/registrations/contrib/json_dump/plugin.py +++ b/src/openforms/registrations/contrib/json_dump/plugin.py @@ -96,7 +96,9 @@ def register_submission( result = client.post(path, json=data) result.raise_for_status() - return {"api_response": result.json()} + result_json = result.json() if result.content else "" + + return {"api_response": result_json} def check_config(self) -> None: # Config checks are not really relevant for this plugin right now