mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-23 20:16:40 +00:00
refactor: parse native JSON request args in setup/doctype/terms_and_conditions/terms_and_conditions.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:
@@ -37,8 +37,7 @@ class TermsandConditions(Document):
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_terms_and_conditions(template_name: str, doc: str | dict):
|
||||
if isinstance(doc, str):
|
||||
doc = json.loads(doc)
|
||||
doc = frappe.parse_json(doc)
|
||||
|
||||
terms_and_conditions = frappe.get_doc("Terms and Conditions", template_name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user