Skip to content

Commit

Permalink
Generate error when find query is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
deniszh committed May 22, 2018
1 parent fb469e5 commit e5911ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions webapp/graphite/metrics/views.py
Expand Up @@ -99,6 +99,10 @@ def find_view(request):
return HttpResponseBadRequest(content="Missing required parameter 'query'",
content_type='text/plain')

if query == '':
return HttpResponseBadRequest(content="Required parameter 'query' is empty",
content_type='text/plain')

if '.' in query:
base_path = query.rsplit('.', 1)[0] + '.'
else:
Expand Down

0 comments on commit e5911ee

Please sign in to comment.