Fix str convertion of buffer if False in Report

issue2335
review198005
This commit is contained in:
Cédric Krier committed 2011-12-09 12:18:49 +01:00
1 parent e147372214
commit 7c54cb0d6c
1 file changed
+4 -2
+4 -2
View File
@@ -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!')