fix: Export report pdf failed

This commit is contained in:
wangruidong
2025-09-15 18:47:12 +08:00
committed by 老广
parent 307befdacd
commit 93906dff0a

View File

@@ -61,7 +61,6 @@ charts_map = {
def export_chart_to_pdf(chart_name, sessionid, request=None):
chart_info = charts_map.get(chart_name)
if not chart_info:
return None, None
@@ -104,6 +103,7 @@ def export_chart_to_pdf(chart_name, sessionid, request=None):
except Exception as e:
print(f'Playwright error: {e}')
pdf_bytes = None
page_title = chart_info['title']
finally:
browser.close()
return pdf_bytes, page_title