diff --git a/.gitignore b/.gitignore index 81642b0e1447e..8928fea0c32dc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,8 @@ babel _build _static caravel/bin/caravelc -envpy3 +env_py3 +.eggs build *.db tmp diff --git a/caravel/forms.py b/caravel/forms.py index fe7146ba6ed72..cfb59653dfad1 100644 --- a/caravel/forms.py +++ b/caravel/forms.py @@ -38,7 +38,7 @@ def iter_choices(self): if value: yield d.pop(value) while d: - yield d.pop(d.keys()[0]) + yield d.popitem(last=False)[1] class FreeFormSelect(widgets.Select): @@ -82,6 +82,7 @@ def get_field(self, fieldname): return getattr(self, fieldname) def field_css_classes(self, fieldname): + print(fieldname, self.css_classes[fieldname]) if fieldname in self.css_classes: return " ".join(self.css_classes[fieldname]) return "" diff --git a/caravel/templates/caravel/explore.html b/caravel/templates/caravel/explore.html index a8fe55f7e3d2d..da6cd79b8a090 100644 --- a/caravel/templates/caravel/explore.html +++ b/caravel/templates/caravel/explore.html @@ -112,7 +112,7 @@ {% for fieldname in fieldset.fields %} {% if not fieldname %}
- {% elif not fieldname.__iter__ %} + {% elif fieldname is string %} {{ panofield(fieldname) }} {% else %}
diff --git a/caravel/views.py b/caravel/views.py index 11f76f58d1c62..f6aa4123a0913 100644 --- a/caravel/views.py +++ b/caravel/views.py @@ -467,8 +467,9 @@ def explore(self, datasource_type, datasource_id): else: template = "caravel/explore.html" + resp = self.render_template(template, viz=obj, slice=slc) try: - resp = self.render_template(template, viz=obj, slice=slc) + pass except Exception as e: if config.get("DEBUG"): raise(e) diff --git a/setup.py b/setup.py index f5055fe9b7860..ef304c15bef22 100644 --- a/setup.py +++ b/setup.py @@ -19,6 +19,7 @@ 'flask-cache>=0.13.1, <0.14.0', 'flask-migrate>=1.5.1, <2.0.0', 'flask-script>=2.0.5, <3.0.0', + 'flask-sqlalchemy==2.0.0', 'flask-testing>=0.4.2, <0.5.0', 'flask>=0.10.1, <1.0.0', 'humanize>=0.5.1, <0.6.0', diff --git a/tests/core_tests.py b/tests/core_tests.py index e55e5db788152..01239949bca4d 100644 --- a/tests/core_tests.py +++ b/tests/core_tests.py @@ -70,7 +70,7 @@ def test_dashboard(self): urls[dash.dashboard_title] = dash.url for title, url in urls.items(): print(url) - assert escape(title) in self.client.get(url).data + assert escape(title) in self.client.get(url).data.decode('utf-8') def test_doctests(self): modules = [utils] @@ -80,8 +80,8 @@ def test_doctests(self): raise Exception("Failed a doctest") def test_misc(self): - assert self.client.get('/health').data == "OK" - assert self.client.get('/ping').data == "OK" + assert self.client.get('/health').data.decode('utf-8') == "OK" + assert self.client.get('/ping').data.decode('utf-8') == "OK" if __name__ == '__main__':