fix: pytz to filter out deprecated timezones (#38751)
This commit is contained in:
parent
8054844193
commit
b484cf0136
2 changed files with 9 additions and 4 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
Loading…
Add table
Reference in a new issue