From 909995a441c3fe9d1c757bede91a66c021f1e451 Mon Sep 17 00:00:00 2001
From: Dany Robert <rtdany10@gmail.com>
Date: Thu, 29 Jul 2021 15:58:27 +0530
Subject: [PATCH] fix: issue with cache.setex

---
 erpnext/setup/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py
index 33af28687c..27237bf2cb 100644
--- a/erpnext/setup/utils.py
+++ b/erpnext/setup/utils.py
@@ -107,7 +107,7 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=No
 			# expire in 6 hours
 			response.raise_for_status()
 			value = response.json()["result"]
-			cache.setex(key, value, 6 * 60 * 60)
+			cache.setex(name=key, time=21600, value=flt(value))
 		return flt(value)
 	except:
 		frappe.log_error(title="Get Exchange Rate")