mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-15 07:28:39 +00:00
refactor: parse native JSON request args in assets/doctype/asset/mapper.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:
@@ -162,8 +162,7 @@ def make_asset_movement(
|
||||
assets: list[dict] | str,
|
||||
purpose: str = "Transfer",
|
||||
):
|
||||
if isinstance(assets, str):
|
||||
assets = json.loads(assets)
|
||||
assets = frappe.parse_json(assets)
|
||||
|
||||
if len(assets) == 0:
|
||||
frappe.throw(_("At least one asset has to be selected."))
|
||||
|
||||
Reference in New Issue
Block a user