From dcc8d08521cc7f4315f1e6b28c3f1ee008818811 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:32 +0530 Subject: [PATCH] refactor: parse native JSON request args in crm/doctype/contract_template/contract_template.py Use frappe.parse_json instead of json.loads so the whitelisted endpoints accept native JSON types (list/dict/bool) in addition to JSON strings. --- erpnext/crm/doctype/contract_template/contract_template.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/crm/doctype/contract_template/contract_template.py b/erpnext/crm/doctype/contract_template/contract_template.py index d2a77e426f4..b9dc9c8b7f3 100644 --- a/erpnext/crm/doctype/contract_template/contract_template.py +++ b/erpnext/crm/doctype/contract_template/contract_template.py @@ -35,8 +35,7 @@ class ContractTemplate(Document): @frappe.whitelist() def get_contract_template(template_name: str, doc: str | dict | Document): - if isinstance(doc, str): - doc = json.loads(doc) + doc = frappe.parse_json(doc) contract_template = frappe.get_doc("Contract Template", template_name) contract_terms = None