diff --git a/superset/legacy.py b/superset/legacy.py index a208dc13583d..8de2548c8e16 100644 --- a/superset/legacy.py +++ b/superset/legacy.py @@ -49,21 +49,21 @@ def cast_filter_data(form_data): def cast_form_data(form_data): """Translates old to new form_data""" d = {} - fields = frontend_config.get('fields', {}) + fields = frontend_config.get('controls', {}) for k, v in form_data.items(): field_config = fields.get(k, {}) ft = field_config.get('type') - if ft == 'CheckboxField': + if ft == 'CheckboxControl': # bug in some urls with dups on bools if isinstance(v, list): v = 'y' in v else: v = True if v in ('true', 'y') or v is True else False - elif v and ft == 'TextField' and field_config.get('isInt'): + elif v and ft == 'TextControl' and field_config.get('isInt'): v = int(v) if v != '' else None - elif v and ft == 'TextField' and field_config.get('isFloat'): + elif v and ft == 'TextControl' and field_config.get('isFloat'): v = float(v) if v != '' else None - elif v and ft == 'SelectField': + elif v and ft == 'SelectControl': if field_config.get('multi'): if type(form_data).__name__ == 'ImmutableMultiDict': v = form_data.getlist(k)