From 5ece1d7c394a80f2d63828601afe517c08cc676c Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Mon, 2 Jan 2023 12:01:32 +0530 Subject: [PATCH] fix: Allow everyone to read geo data (#19451) This is static data present in code, no need to apply permissions. closes https://github.com/frappe/frappe/issues/19394 --- frappe/geo/country_info.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frappe/geo/country_info.py b/frappe/geo/country_info.py index 2aefa27170..3267149d4c 100644 --- a/frappe/geo/country_info.py +++ b/frappe/geo/country_info.py @@ -5,6 +5,7 @@ import json # all country info import os +from functools import lru_cache import frappe from frappe.utils.momentjs import get_all_timezones @@ -27,8 +28,13 @@ def get_all(): return all_data -@frappe.whitelist() +@frappe.whitelist(allow_guest=True) def get_country_timezone_info(): + return _get_country_timezone_info() + + +@lru_cache(maxsize=2) +def _get_country_timezone_info(): return {"country_info": get_all(), "all_timezones": get_all_timezones()}