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
(cherry picked from commit 1e8cd0e)
  • Loading branch information
John Bodley committed Mar 7, 2018
1 parent 16ee3df commit 8c7f1bc
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 @@ -1095,7 +1095,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 8c7f1bc

Please sign in to comment.