timezone: List only canonical timezone identifiers.

For aliases that will no longer be listed, see the third column of

grep '^L ' zulip-py3-venv/lib/python3.*/site-packages/pytz/zoneinfo/tzdata.zi

Time zones previously set to an alias will be canonicalized on demand.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2022-02-09 16:45:44 -08:00
committed by Tim Abbott
parent c4af509339
commit 961633fcec
8 changed files with 17 additions and 8 deletions

View File

@@ -6,6 +6,7 @@ from django.contrib.auth.models import UserManager
from django.utils.timezone import now as timezone_now
from zerver.lib.hotspots import copy_hotspots
from zerver.lib.timezone import canonicalize_timezone
from zerver.lib.upload import copy_avatar
from zerver.lib.utils import generate_api_key
from zerver.models import (
@@ -42,7 +43,7 @@ def copy_default_settings(
return
setattr(target_profile, "full_name", settings_source.full_name)
setattr(target_profile, "timezone", settings_source.timezone)
setattr(target_profile, "timezone", canonicalize_timezone(settings_source.timezone))
target_profile.save()
if settings_source.avatar_source == UserProfile.AVATAR_FROM_USER: