diff --git a/combo/apps/dataviz/models.py b/combo/apps/dataviz/models.py index e01f51c2..2fcce5b2 100644 --- a/combo/apps/dataviz/models.py +++ b/combo/apps/dataviz/models.py @@ -135,6 +135,9 @@ class ChartNgCell(CellBase): def get_additional_label(self): return self.title + def is_relevant(self, context=None): + return bool(self.data_reference) + def save(self, *args, **kwargs): if self.data_reference: site_key, visualization_slug = self.data_reference.split(':') diff --git a/combo/apps/dataviz/templates/combo/chartngcell_form.html b/combo/apps/dataviz/templates/combo/chartngcell_form.html index b72a5663..aafc5394 100644 --- a/combo/apps/dataviz/templates/combo/chartngcell_form.html +++ b/combo/apps/dataviz/templates/combo/chartngcell_form.html @@ -1,6 +1,6 @@
{{ form.as_p }} -{% if cell.chart_type != "table" %} +{% if cell.chart_type != "table" and cell.is_relevant %}