mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-20 03:47:11 +00:00
refactor: parse native JSON request args in selling/doctype/customer/customer.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:
@@ -559,8 +559,7 @@ def check_credit_limit(customer, company, ignore_outstanding_sales_order=False,
|
|||||||
def send_emails(
|
def send_emails(
|
||||||
customer: str, customer_outstanding: float, credit_limit: float, credit_controller_users_list: str | list
|
customer: str, customer_outstanding: float, credit_limit: float, credit_controller_users_list: str | list
|
||||||
):
|
):
|
||||||
if isinstance(credit_controller_users_list, str):
|
credit_controller_users_list = frappe.parse_json(credit_controller_users_list)
|
||||||
credit_controller_users_list = json.loads(credit_controller_users_list)
|
|
||||||
subject = _("Credit limit reached for customer {0}").format(customer)
|
subject = _("Credit limit reached for customer {0}").format(customer)
|
||||||
message = _("Credit limit has been crossed for customer {0} ({1}/{2})").format(
|
message = _("Credit limit has been crossed for customer {0} ({1}/{2})").format(
|
||||||
customer, customer_outstanding, credit_limit
|
customer, customer_outstanding, credit_limit
|
||||||
|
|||||||
Reference in New Issue
Block a user