Skip to content

Commit ca902cc

Browse files
committed
check for chart images as well for resource chart images
1 parent 9c595a9 commit ca902cc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

api/models/Dataset.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,13 @@ def formats_indexing(self) -> list[str]:
108108

109109
@property
110110
def has_charts(self) -> bool:
111-
"""Has charts.
111+
"""Has charts or chart images.
112112
113113
Used in Elasticsearch indexing.
114114
"""
115-
return bool(self.resources.filter(resourcechartdetails__isnull=False).exists())
115+
has_charts = self.resources.filter(resourcechartdetails__isnull=False).exists()
116+
has_chart_images = self.chart_images.exists()
117+
return has_charts or has_chart_images
116118

117119
@property
118120
def download_count(self) -> int:

0 commit comments

Comments
 (0)