From 1f8be8498570d8de0299f0cea5da6a566c39283b Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Thu, 4 Nov 2021 05:12:09 +0000 Subject: [PATCH] fix : remove mutable data structures from argument defaults --- erpnext/setup/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py index 4fcd7d5936f..c8b4374bac6 100644 --- a/erpnext/setup/utils.py +++ b/erpnext/setup/utils.py @@ -122,11 +122,11 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=No frappe.msgprint(_("Unable to find exchange rate for {0} to {1} for key date {2}. Please create a Currency Exchange record manually").format(from_currency, to_currency, transaction_date)) return 0.0 -def format_ces_api(data="", param={}): +def format_ces_api(data, param): return data.format( - transaction_date=param["transaction_date"], - to_currency=param["to_currency"], - from_currency=param["from_currency"] + transaction_date=param.get("transaction_date"), + to_currency=param.get("to_currency"), + from_currency=param.get("from_currency") ) def enable_all_roles_and_domains():