diff --git a/experimenter/experimenter/experiments/models.py b/experimenter/experimenter/experiments/models.py index e78a765a33..2db7c08365 100644 --- a/experimenter/experimenter/experiments/models.py +++ b/experimenter/experimenter/experiments/models.py @@ -1212,7 +1212,7 @@ def has_displayable_results(self): if self.results_data and "v3" in self.results_data: results_data = self.results_data["v3"] for window in ["overall", "weekly"]: - if window in results_data: + if results_data.get(window): enrollments = results_data[window].get("enrollments", {}).get("all") if enrollments is not None: return True diff --git a/experimenter/experimenter/experiments/tests/test_models.py b/experimenter/experimenter/experiments/tests/test_models.py index 7a31e69f1d..806ccf63fc 100644 --- a/experimenter/experimenter/experiments/tests/test_models.py +++ b/experimenter/experimenter/experiments/tests/test_models.py @@ -2458,6 +2458,7 @@ def test_has_displayable_results_true(self, results_data): ({"v3": {"weekly": {"enrollments": {}}}},), ({"v3": {"overall": {"enrollments": {"all": None}}}},), ({"v3": {"weekly": {"enrollments": {"all": None}}}},), + ({"v3": {"overall": None}},), ] ) def test_has_displayable_results_false(self, results_data):