Skip to content
Browse files

Better check for no hits.

  • Loading branch information...
1 parent f6343f6 commit 9939590d8129ba17604deba92f735cfb36a444b6 @grigorescu committed Oct 18, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 Brownian/view/views.py
View
2 Brownian/view/views.py
@@ -46,7 +46,7 @@ def query(request):
except:
data["error"] = "Could not connect to ElasticSearch server for query - please check ElasticSearch cluster health."
return render(request, "home.html", data)
- if data["hits"]["total"] == 0:
+ if not data["hits"]:
data["error"] = "Query returned no hits."
return render(request, "home.html", data)
# To make the Javascript easier, we strip off the # from the currently open tab.

0 comments on commit 9939590

Please sign in to comment.
Something went wrong with that request. Please try again.