Skip to content

Commit

Permalink
[payload] Set status code on error rather than query status
Browse files Browse the repository at this point in the history
  • Loading branch information
John Bodley committed Mar 7, 2018
1 parent b63dc91 commit 1e8cd0e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,10 @@ def generate_json(self, datasource_type, datasource_id, form_data,
return json_error_response(utils.error_msg_from_exception(e))

status = 200
if payload.get('status') == QueryStatus.FAILED:
if (
payload.get('status') == QueryStatus.FAILED or
payload.get('error') is not None
):
status = 400

return json_success(viz_obj.json_dumps(payload), status=status)
Expand Down

0 comments on commit 1e8cd0e

Please sign in to comment.