Skip to content

Commit

Permalink
Making sure to alert only once
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Oct 4, 2015
1 parent f83d933 commit 959418c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions panoramix/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,16 @@ class QueryForm(OmgWtForm):
json = HiddenField()
previous_viz_type = HiddenField()


filter_cols = datasource.filterable_column_names or ['']
for i in range(10):
setattr(QueryForm, 'flt_col_' + str(i), SelectField(
'Filter 1',
default='',
choices=[(s, s) for s in datasource.filterable_column_names]))
default=filter_cols[0],
choices=self.choicify(filter_cols)))
setattr(QueryForm, 'flt_op_' + str(i), SelectField(
'Filter 1',
default='',
choices=[(m, m) for m in ['in', 'not in']]))
default='in',
choices=self.choicify(['in', 'not in'])))
setattr(
QueryForm, 'flt_eq_' + str(i),
TextField("Super", default=''))
Expand Down
6 changes: 3 additions & 3 deletions panoramix/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ def __init__(self, datasource, form_data):
form = form_class(form_data)
else:
form = form_class(**form_data)

data = form.data.copy()
if not form.validate():
for k, v in form.errors.items():
if not k.startswith("flt") and not form_data.get('token'):
if not data.get('json') and not data.get('async'):
flash("{}: {}".format(k, " ".join(v)), 'danger')

data = form.data.copy()
previous_viz_type = form_data.get('previous_viz_type')
if previous_viz_type in viz_types and previous_viz_type != self.viz_type:
data = {
Expand Down

0 comments on commit 959418c

Please sign in to comment.