Skip to content

Commit

Permalink
[hotfix] legacy url not handled properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Apr 14, 2017
1 parent a2b30f3 commit d2ea9b1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions superset/legacy.py
Expand Up @@ -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)
Expand Down

0 comments on commit d2ea9b1

Please sign in to comment.