mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-12 14:11:46 +00:00
refactor: parse native JSON request args in utilities/bulk_transaction.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:
@@ -13,13 +13,9 @@ def transaction_processing(
|
||||
frappe.has_permission(from_doctype, "read", throw=True)
|
||||
frappe.has_permission(to_doctype, "create", throw=True)
|
||||
|
||||
if isinstance(data, str):
|
||||
deserialized_data = json.loads(data)
|
||||
else:
|
||||
deserialized_data = data
|
||||
deserialized_data = frappe.parse_json(data)
|
||||
|
||||
if isinstance(args, str):
|
||||
args = frappe._dict(json.loads(args))
|
||||
args = frappe._dict(frappe.parse_json(args))
|
||||
|
||||
skipped_records = [d for d in deserialized_data if d.get("status") in ("On Hold", "Closed")]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user