some error handling for WordCloud

This commit is contained in:
Maxime Beauchemin 2016-01-11 14:42:45 -08:00
parent 3efaec8983
commit 6c92fa471d
1 changed files with 3 additions and 0 deletions

View File

@ -445,6 +445,9 @@ class WordCloudViz(BaseViz):
def query_obj(self):
d = super(WordCloudViz, self).query_obj()
if len(d['groupby']) < 1:
raise Exception("Pick at least one field to group by")
metric = self.form_data.get('metric')
if not metric:
raise Exception("Pick a metric!")