From b5614a433ef2acc8650c2a0a672c8da227db3d31 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Thu, 2 Jun 2016 12:39:21 -0700 Subject: [PATCH] Fixing 2 bugs that happen when fields are removed from table (#551) --- caravel/assets/javascripts/explore.js | 3 ++- caravel/forms.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/caravel/assets/javascripts/explore.js b/caravel/assets/javascripts/explore.js index 55c71b90e0c81..fe64c85e59fd9 100644 --- a/caravel/assets/javascripts/explore.js +++ b/caravel/assets/javascripts/explore.js @@ -237,7 +237,8 @@ function initExploreView() { function set_filters() { for (var i = 1; i < 10; i++) { var eq = px.getParam("flt_eq_" + i); - if (eq !== '') { + var col = px.getParam("flt_col_" + i); + if (eq !== '' && col !== '') { add_filter(i); } } diff --git a/caravel/forms.py b/caravel/forms.py index fa9227d43c7ce..d7c77439ce69c 100644 --- a/caravel/forms.py +++ b/caravel/forms.py @@ -52,7 +52,7 @@ def iter_choices(self): d[value] = (value, label, selected) if self.data: for value in self.data: - if value: + if value and value in d: yield d.pop(value) while d: yield d.popitem(last=False)[1]