fix: pytz to filter out deprecated timezones (#38751)

This commit is contained in:
RitvikSardana 2026-04-24 14:06:40 +05:30 committed by GitHub
parent 8054844193
commit b484cf0136
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View file

@ -4,7 +4,7 @@
import re
from collections.abc import Iterable
from datetime import timedelta
from functools import cached_property
from functools import cached_property, lru_cache
from typing import Any
import frappe
@ -894,9 +894,14 @@ class User(Document):
@frappe.whitelist()
def get_timezones():
import zoneinfo
return {"timezones": _get_timezones()}
return {"timezones": zoneinfo.available_timezones()}
@lru_cache(maxsize=1)
def _get_timezones():
import pytz
return sorted(pytz.common_timezones)
@frappe.whitelist()