mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-23 12:29:47 +00:00
fix: Export report pdf failed
This commit is contained in:
@@ -61,7 +61,6 @@ charts_map = {
|
|||||||
|
|
||||||
def export_chart_to_pdf(chart_name, sessionid, request=None):
|
def export_chart_to_pdf(chart_name, sessionid, request=None):
|
||||||
chart_info = charts_map.get(chart_name)
|
chart_info = charts_map.get(chart_name)
|
||||||
|
|
||||||
if not chart_info:
|
if not chart_info:
|
||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
@@ -104,6 +103,7 @@ def export_chart_to_pdf(chart_name, sessionid, request=None):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f'Playwright error: {e}')
|
print(f'Playwright error: {e}')
|
||||||
pdf_bytes = None
|
pdf_bytes = None
|
||||||
|
page_title = chart_info['title']
|
||||||
finally:
|
finally:
|
||||||
browser.close()
|
browser.close()
|
||||||
return pdf_bytes, page_title
|
return pdf_bytes, page_title
|
||||||
|
Reference in New Issue
Block a user