From f16854559d13e29ecb2ce32773a26c9ebd3271a0 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 18 May 2017 13:39:07 +0530 Subject: [PATCH] [minor] Handle string with no html tag in xlsxutils (#3332) --- frappe/utils/xlsxutils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frappe/utils/xlsxutils.py b/frappe/utils/xlsxutils.py index bf43219608..2915bad06f 100644 --- a/frappe/utils/xlsxutils.py +++ b/frappe/utils/xlsxutils.py @@ -37,6 +37,12 @@ def make_xlsx(data, sheet_name): def handle_html(data): + # return if no html tags found + if '<' not in data: + return data + if '>' not in data: + return data + from html2text import unescape, HTML2Text h = HTML2Text()