fix missing multiple values for the same parameter name (#565)

This commit is contained in:
Marigold 2016-06-11 16:55:01 +02:00 committed by Maxime Beauchemin
parent 4661b0210d
commit 1631137da1

View File

@ -21,7 +21,7 @@ from flask_babelpkg import lazy_gettext as _
from markdown import markdown
import json
from six import string_types
from werkzeug.datastructures import ImmutableMultiDict
from werkzeug.datastructures import ImmutableMultiDict, MultiDict
from werkzeug.urls import Href
from dateutil import relativedelta as rdelta
@ -110,12 +110,13 @@ class BaseViz(object):
del d['action']
d.update(kwargs)
# Remove unchecked checkboxes because HTML is weird like that
od = OrderedDict()
od = MultiDict()
for key in sorted(d.keys()):
if d[key] is False:
del d[key]
else:
od[key] = d[key]
for v in d.getlist(key):
od.add(key, v)
href = Href(
'/caravel/explore/{self.datasource.type}/'
'{self.datasource.id}/'.format(**locals()))