From 99c49c27076b77a2334d4117fbb105d8de7e58f9 Mon Sep 17 00:00:00 2001 From: Nick Pellegrino Date: Mon, 24 Dec 2018 15:56:22 -0500 Subject: [PATCH] don't give hyperlink styling to non-string cells --- corehq/ex-submodules/couchexport/writers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/corehq/ex-submodules/couchexport/writers.py b/corehq/ex-submodules/couchexport/writers.py index d6366c9b4801..93318003e0dc 100644 --- a/corehq/ex-submodules/couchexport/writers.py +++ b/corehq/ex-submodules/couchexport/writers.py @@ -413,8 +413,10 @@ def get_write_value(value): cell.number_format = numbers.FORMAT_TEXT if isinstance(row, FormattedRow): for hyperlink_column_index in row.hyperlink_column_indices: - cells[hyperlink_column_index].hyperlink = cells[hyperlink_column_index].value - cells[hyperlink_column_index].style = 'Hyperlink' + cell_value = cells[hyperlink_column_index].value + if isinstance(cell_value, six.string_types): + cells[hyperlink_column_index].hyperlink = cell_value + cells[hyperlink_column_index].style = 'Hyperlink' sheet.append(cells) def _close(self):