mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-22 02:40:02 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user