From 2f0367807f8c088bba6e41065c4cb08630e0b657 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:30 +0530 Subject: [PATCH] refactor: parse native JSON request args in accounts/doctype/bank_statement_import/bank_statement_import.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. --- .../doctype/bank_statement_import/bank_statement_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py index facaf80c008..4554ab6a3a2 100644 --- a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py +++ b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py @@ -290,7 +290,7 @@ def update_mapping_db(bank, template_options): for d in bank.bank_transaction_mapping: d.delete() - for d in json.loads(template_options)["column_to_field_map"].items(): + for d in frappe.parse_json(template_options)["column_to_field_map"].items(): bank.append("bank_transaction_mapping", {"bank_transaction_field": d[1], "file_field": d[0]}) bank.save()