From aea9547ede848350bd319fc2830c05bf78e5bd1a Mon Sep 17 00:00:00 2001 From: thenav56 Date: Mon, 29 Apr 2019 20:48:48 +0545 Subject: [PATCH] Add additional check for tabular field in Data Series Entry --- apps/export/entries/report_exporter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/export/entries/report_exporter.py b/apps/export/entries/report_exporter.py index 0e6c3ea54c..7b6ae7b3a6 100644 --- a/apps/export/entries/report_exporter.py +++ b/apps/export/entries/report_exporter.py @@ -66,9 +66,9 @@ def _generate_for_entry(self, entry): if entry.entry_type == Entry.IMAGE: image = entry.image # para.add_run().add_image(entry.image) - elif entry.entry_type == Entry.DATA_SERIES: + elif entry.entry_type == Entry.DATA_SERIES and entry.tabular_field: image = viz_renderer.get_entry_image(entry) - health_stats = entry.tabular_field.cache.get('health_stats', {}) + health_stats = (entry.tabular_field.cache or {}).get('health_stats', {}) image_text = ' Total values: {}, Invalid value: {}, Null value: {}'.format( health_stats.get('total', 'N/A'), health_stats.get('invalid', 'N/A'),