mirror of https://github.com/apache/superset.git
Making sure to alert only once
This commit is contained in:
parent
f83d93327f
commit
959418cc4e
|
@ -219,16 +219,16 @@ class FormFactory(object):
|
|||
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=''))
|
||||
|
|
|
@ -41,12 +41,12 @@ class BaseViz(object):
|
|||
form = form_class(form_data)
|
||||
else:
|
||||
form = form_class(**form_data)
|
||||
if not form.validate():
|
||||
for k, v in form.errors.items():
|
||||
if not k.startswith("flt") and not form_data.get('token'):
|
||||
flash("{}: {}".format(k, " ".join(v)), 'danger')
|
||||
|
||||
data = form.data.copy()
|
||||
if not form.validate():
|
||||
for k, v in form.errors.items():
|
||||
if not data.get('json') and not data.get('async'):
|
||||
flash("{}: {}".format(k, " ".join(v)), 'danger')
|
||||
previous_viz_type = form_data.get('previous_viz_type')
|
||||
if previous_viz_type in viz_types and previous_viz_type != self.viz_type:
|
||||
data = {
|
||||
|
|
Loading…
Reference in New Issue