瀏覽代碼

fix(pdf): Cleanup temporary files after pdf generation

This was removed in https://github.com/frappe/frappe/pull/7358
version-14
Aditya Hase 4 年之前
父節點
當前提交
8feba5fa9b
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: A55F0FCA0234972
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. +3
    -4
      frappe/utils/pdf.py

+ 3
- 4
frappe/utils/pdf.py 查看文件

@@ -52,6 +52,8 @@ def get_pdf(html, options=None, output=None):
output.appendPagesFromReader(reader)
else:
raise
finally:
cleanup(options)

if "password" in options:
password = options["password"]
@@ -184,10 +186,7 @@ def prepare_header_footer(soup):
return options


def cleanup(fname, options):
if os.path.exists(fname):
os.remove(fname)

def cleanup(options):
for key in ("header-html", "footer-html"):
if options.get(key) and os.path.exists(options[key]):
os.remove(options[key])


Loading…
取消
儲存