Skip to content

Commit

Permalink
🐛 [#5012] Fix handling of response after post request in JSON dump
Browse files Browse the repository at this point in the history
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
  • Loading branch information
viktorvanwijk committed Feb 5, 2025
1 parent 60ac420 commit ee1433c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/openforms/registrations/contrib/json_dump/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ee1433c

Please sign in to comment.