From a60301f786f798eba573cbb08b0e2c7957b319a4 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Thu, 10 Aug 2023 20:46:19 +0530 Subject: [PATCH] fix: generate csrf_token and add as context to crm.html --- crm/www/crm.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 crm/www/crm.py diff --git a/crm/www/crm.py b/crm/www/crm.py new file mode 100644 index 00000000..9c15f3f6 --- /dev/null +++ b/crm/www/crm.py @@ -0,0 +1,14 @@ +# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors +# GNU GPLv3 License. See license.txt + +from __future__ import unicode_literals + +import frappe + +no_cache = 1 + + +def get_context(context): + csrf_token = frappe.sessions.get_csrf_token() + frappe.db.commit() + context.csrf_token = csrf_token \ No newline at end of file