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