refactor: parse native JSON request args in crm/frappe_crm_api.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 50f2654eb1
commit ffa85a4ed6

View File

@@ -69,8 +69,7 @@ def create_contacts(contacts, organization=None, link_doctype=None, link_docname
def create_address(doctype, docname, address):
if not address:
return
if isinstance(address, str):
address = json.loads(address)
address = frappe.parse_json(address)
try:
_address = frappe.db.exists("Address", address.get("name"))
if not _address: