From dadf4f7d064567f0724dd01c6aad79f851f7db57 Mon Sep 17 00:00:00 2001 From: Julie Pichon Date: Fri, 8 Feb 2013 16:50:02 +0000 Subject: [PATCH] Timezones can change - display the current tz offset As noted in the reviews for the backport (20467), the initial patch for bug 1103003 didn't account for timezones changing over time. Change-Id: Iceab7deb803669c56aa21252561f650f8c4a601d --- openstack_dashboard/dashboards/settings/user/forms.py | 2 +- openstack_dashboard/dashboards/settings/user/tests.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/dashboards/settings/user/forms.py b/openstack_dashboard/dashboards/settings/user/forms.py index e0cd19f3a..059f89408 100644 --- a/openstack_dashboard/dashboards/settings/user/forms.py +++ b/openstack_dashboard/dashboards/settings/user/forms.py @@ -39,7 +39,7 @@ class UserSettingsForm(forms.SelfHandlingForm): self.fields['language'].choices = languages # Timezones - d = datetime(2011, 1, 1) + d = datetime(datetime.today().year, 1, 1) timezones = [] for tz in pytz.common_timezones: try: diff --git a/openstack_dashboard/dashboards/settings/user/tests.py b/openstack_dashboard/dashboards/settings/user/tests.py index 4535d6f30..8f38ae556 100644 --- a/openstack_dashboard/dashboards/settings/user/tests.py +++ b/openstack_dashboard/dashboards/settings/user/tests.py @@ -29,3 +29,4 @@ class UserSettingsTest(test.TestCase): self.assertContains(res, "Australia/Melbourne (UTC +11:00)") self.assertContains(res, "Canada/Newfoundland (UTC -03:30)") + self.assertContains(res, "Europe/Moscow (UTC +04:00)")