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 Jan 31, 2025
1 parent 1965c0b commit b71f8c3
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 @@ -99,7 +99,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 b71f8c3

Please sign in to comment.