mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-01 07:37:04 +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):
|
def get_applied_pricing_rules(pricing_rules):
|
||||||
if pricing_rules:
|
if pricing_rules:
|
||||||
if pricing_rules.startswith("["):
|
if pricing_rules.startswith("["):
|
||||||
return json.loads(pricing_rules)
|
return frappe.parse_json(pricing_rules)
|
||||||
else:
|
else:
|
||||||
return pricing_rules.split(",")
|
return pricing_rules.split(",")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user