Skip to content

Commit

Permalink
Fixing multi value parsing on old URL (#2277)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Feb 26, 2017
1 parent ea72c6b commit ed2935e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions superset/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ def cast_form_data(form_data):
elif v and ft == 'TextField' and field_config.get('isFloat'):
v = float(v) if v != '' else None
elif v and ft == 'SelectField':
if field_config.get('multi') and not isinstance(v, list):
v = [v]
if field_config.get('multi'):
if type(form_data).__name__ == 'ImmutableMultiDict':
v = form_data.getlist(k)
elif not isinstance(v, list):
v = [v]
if d.get('slice_id'):
d['slice_id'] = int(d['slice_id'])

Expand Down
2 changes: 1 addition & 1 deletion superset/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ def get_form_data(self):

if request.args.get("viz_type"):
# Converting old URLs
d = cast_form_data(request.args.to_dict())
d = cast_form_data(request.args)

extra_filters = request.args.get("extra_filters")
filters = d.get('filters', [])
Expand Down

0 comments on commit ed2935e

Please sign in to comment.