mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-11 05:31:48 +00:00
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:
@@ -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(",")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user