mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
[hotfix] legacy url not handled properly
This commit is contained in:
parent
c43a9fd554
commit
612b8ca3d7
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user