Skip to content

Commit

Permalink
updated spiffworkflow-connector-command w/ burnettk
Browse files Browse the repository at this point in the history
  • Loading branch information
jasquat committed Oct 17, 2023
1 parent 53fcd3e commit 1dc289c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions src/spiffworkflow_proxy/blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,18 @@ def do_command(plugin_display_name: str, command_name: str) -> Response:
status=500
)

status_code = int(result['status'])
return_response = result["response"]
response = json.dumps(return_response)
return Response(response, mimetype=result["mimetype"], status=status_code)
if "command_response_version" in result and result["command_response_version"] > 1: # type: ignore
response = json.dumps(result)
return Response(response, mimetype='application/json', status=200)
else:
status_code = 200
if 'status' in result:
status_code = int(result['status']) # type: ignore
if isinstance(result["response"], dict): # type: ignore
response = json.dumps(result["response"]) # type: ignore
else:
response = result["response"] # type: ignore
return Response(response, mimetype=result["mimetype"], status=status_code) # type: ignore


@proxy_blueprint.route("/v1/auths")
Expand Down

0 comments on commit 1dc289c

Please sign in to comment.