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:
Mihir Kandoi
2026-06-24 20:37:34 +05:30
parent 76705dd736
commit 460b8c5d8d

View File

@@ -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)