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.
This commit is contained in:
Mihir Kandoi
2026-06-24 20:37:32 +05:30
parent 0ff4840dcb
commit dcc8d08521

View File

@@ -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