Merge pull request #11770 from surajshetty3416/fix-random-cookie-failure

fix: Build cookie jar only if request object is present
This commit is contained in:
mergify[bot] 2020-10-24 12:49:16 +00:00 committed by GitHub
commit d7bda21769
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,7 +124,7 @@ def prepare_options(html, options):
def get_cookie_options():
options = {}
if frappe.session and frappe.session.sid:
if frappe.session and frappe.session.sid and hasattr(frappe.local, "request"):
# Use wkhtmltopdf's cookie-jar feature to set cookies and restrict them to host domain
cookiejar = "/tmp/{}.jar".format(frappe.generate_hash())