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()

View file

@ -260,4 +260,4 @@ execute:from frappe.email.doctype.notification.notification import install_notif
execute:frappe.db.set_value("Email Account", {}, "add_x_original_from", 1)
frappe.patches.v16_0.fix_myanmar_language_name
execute:frappe.db.set_value("Email Account", {}, "add_reply_to_header", 1)
frappe.patches.v16_0.set_reply_to_header
frappe.patches.v16_0.set_reply_to_header