From 78f38970c1f8aa8d0dc0f12d6a4a77059df9415b Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:34 +0530 Subject: [PATCH] refactor: parse native JSON request args in setup/doctype/department/department.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. --- erpnext/setup/doctype/department/department.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/setup/doctype/department/department.py b/erpnext/setup/doctype/department/department.py index 71cf6e96743..a92c77f249d 100644 --- a/erpnext/setup/doctype/department/department.py +++ b/erpnext/setup/doctype/department/department.py @@ -77,8 +77,7 @@ def get_children( is_root: bool = False, include_disabled: str | dict | None = None, ): - if isinstance(include_disabled, str): - include_disabled = json.loads(include_disabled) + include_disabled = frappe.parse_json(include_disabled) fields = ["name as value", "is_group as expandable"] filters = {}