Skip to content

Commit

Permalink
Merge pull request getredash#1116 from getredash/feature/params_ui
Browse files Browse the repository at this point in the history
Return meaningful error when there is no cached result.
  • Loading branch information
arikfr authored Jun 14, 2016
2 parents 46b0f2a + 87f24e1 commit b9bcbf0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion handlers/query_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ def get(self, query_id=None, query_result_id=None, filetype='json'):

if query_result_id:
query_result = get_object_or_404(models.QueryResult.get_by_id_and_org, query_result_id, self.current_org)
else:
query_result = None

if query_result:
require_access(query_result.data_source.groups, self.current_user, view_only)
Expand Down Expand Up @@ -156,7 +158,7 @@ def get(self, query_id=None, query_result_id=None, filetype='json'):
return response

else:
abort(404)
abort(404, message='No cached result found for this query.')

def make_json_response(self, query_result):
data = json.dumps({'query_result': query_result.to_dict()}, cls=utils.JSONEncoder)
Expand Down

0 comments on commit b9bcbf0

Please sign in to comment.