Преглед изворни кода

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
No known key found for this signature in database 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…
Откажи
Сачувај