Skip to content

Commit

Permalink
Merge pull request apache#19 from john-bodley/john-bodley-cherry-pick…
Browse files Browse the repository at this point in the history
…-4567

[payload] Set status code on error rather than query status
  • Loading branch information
john-bodley authored Mar 7, 2018
2 parents 16ee3df + 8c7f1bc commit fb08fa3
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 fb08fa3

Please sign in to comment.