From 7c54cb0d6cfec61602b05a9782a64622017231c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 9 Dec 2011 12:18:49 +0100 Subject: [PATCH] Fix str convertion of buffer if False in Report issue2335 review198005 --- trytond/report/report.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/trytond/report/report.py b/trytond/report/report.py index 98fd487d49..466a85a64b 100644 --- a/trytond/report/report.py +++ b/trytond/report/report.py @@ -166,8 +166,10 @@ class Report(URLMixin): localcontext['setLang'] = lambda language: translate.set_language(language) # Convert to str as buffer from DB is not supported by StringIO - report_content = str(report.report_content) - style_content = str(report.style_content) + report_content = (str(report.report_content) if report.report_content + else False) + style_content = (str(report.style_content) if report.style_content + else False) if not report_content: raise Exception('Error', 'Missing report file!')