refactor: parse native JSON request args in accounts/doctype/dunning/dunning.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:30 +05:30
parent 475cd83861
commit e37c7e9b32

View File

@@ -248,8 +248,7 @@ def get_dunning_letter_text(dunning_type: str, doc: str | dict, language: str |
DOCTYPE = "Dunning Letter Text"
FIELDS = ["body_text", "closing_text", "language"]
if isinstance(doc, str):
doc = json.loads(doc)
doc = frappe.parse_json(doc)
if not language:
language = doc.get("language")