refactor: parse native JSON request args in accounts/doctype/pricing_rule/utils.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:31 +05:30
parent 2bc943c7e2
commit ffce7aff55

View File

@@ -636,7 +636,7 @@ def remove_free_item(doc):
def get_applied_pricing_rules(pricing_rules):
if pricing_rules:
if pricing_rules.startswith("["):
return json.loads(pricing_rules)
return frappe.parse_json(pricing_rules)
else:
return pricing_rules.split(",")