Public bug reported: On opening the 'Settings' form the top right menu, the user gets the settings page on which he can change password ar select a different timezone. The timezones that are presented are created from all existing timezones. However the locales may not be available for alle these timezones. For example when 'US/Samoa' is not present, the UI will crash.
Proposed change is to only present timezones to the user for which a locale settings is available This is proposed change: <pre> a/openstack_dashboard/dashboards/settings/user/forms.py b/openstack_dashboard/dashboards/settings/user/forms.py index 1c1f58dfa..d533ef3f6 100644 --- a/openstack_dashboard/dashboards/settings/user/forms.py +++ b/openstack_dashboard/dashboards/settings/user/forms.py @@ -82,8 +82,12 @@ class UserSettingsForm(forms.SelfHandlingForm): elif tz == "GMT": tz_name = _("GMT") else: - tz_label = babel.dates.get_timezone_location( - tz, locale=babel_locale) + try: + tz_label = babel.dates.get_timezone_location( + tz, locale=babel_locale) + except: + continue + # Translators: UTC offset and timezone label tz_name = _("%(offset)s: %(label)s") % {"offset": utc_offset, "label": tz_label} </pre> ** Affects: horizon Importance: Undecided Status: New ** Description changed: On opening the 'Settings' form the top right menu, the user gets the settings page on which he can change password ar select a different timezone. The timezones that are presented are created from all existing timezones. However the locales may not be available for alle these timezones. For example when 'US/Samoa' is not present, the UI will crash. Proposed change is to only present timezones to the user for which a locale settings is available This is proposed change: + ``` a/openstack_dashboard/dashboards/settings/user/forms.py b/openstack_dashboard/dashboards/settings/user/forms.py index 1c1f58dfa..d533ef3f6 100644 --- a/openstack_dashboard/dashboards/settings/user/forms.py +++ b/openstack_dashboard/dashboards/settings/user/forms.py @@ -82,8 +82,12 @@ class UserSettingsForm(forms.SelfHandlingForm): - elif tz == "GMT": - tz_name = _("GMT") - else: + elif tz == "GMT": + tz_name = _("GMT") + else: - tz_label = babel.dates.get_timezone_location( - tz, locale=babel_locale) + try: + tz_label = babel.dates.get_timezone_location( + tz, locale=babel_locale) + except: + continue + - # Translators: UTC offset and timezone label - tz_name = _("%(offset)s: %(label)s") % {"offset": utc_offset, - "label": tz_label} + # Translators: UTC offset and timezone label + tz_name = _("%(offset)s: %(label)s") % {"offset": utc_offset, + "label": tz_label} + ``` ** Description changed: On opening the 'Settings' form the top right menu, the user gets the settings page on which he can change password ar select a different timezone. The timezones that are presented are created from all existing timezones. However the locales may not be available for alle these timezones. For example when 'US/Samoa' is not present, the UI will crash. Proposed change is to only present timezones to the user for which a locale settings is available This is proposed change: - ``` + + <pre> a/openstack_dashboard/dashboards/settings/user/forms.py b/openstack_dashboard/dashboards/settings/user/forms.py index 1c1f58dfa..d533ef3f6 100644 --- a/openstack_dashboard/dashboards/settings/user/forms.py +++ b/openstack_dashboard/dashboards/settings/user/forms.py @@ -82,8 +82,12 @@ class UserSettingsForm(forms.SelfHandlingForm): elif tz == "GMT": tz_name = _("GMT") else: - tz_label = babel.dates.get_timezone_location( - tz, locale=babel_locale) + try: + tz_label = babel.dates.get_timezone_location( + tz, locale=babel_locale) + except: + continue + # Translators: UTC offset and timezone label tz_name = _("%(offset)s: %(label)s") % {"offset": utc_offset, "label": tz_label} - ``` + </pre> -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Dashboard (Horizon). https://bugs.launchpad.net/bugs/2085126 Title: Horizon dashboard crashes on non-exisiting TimeZones Status in OpenStack Dashboard (Horizon): New Bug description: On opening the 'Settings' form the top right menu, the user gets the settings page on which he can change password ar select a different timezone. The timezones that are presented are created from all existing timezones. However the locales may not be available for alle these timezones. For example when 'US/Samoa' is not present, the UI will crash. Proposed change is to only present timezones to the user for which a locale settings is available This is proposed change: <pre> a/openstack_dashboard/dashboards/settings/user/forms.py b/openstack_dashboard/dashboards/settings/user/forms.py index 1c1f58dfa..d533ef3f6 100644 --- a/openstack_dashboard/dashboards/settings/user/forms.py +++ b/openstack_dashboard/dashboards/settings/user/forms.py @@ -82,8 +82,12 @@ class UserSettingsForm(forms.SelfHandlingForm): elif tz == "GMT": tz_name = _("GMT") else: - tz_label = babel.dates.get_timezone_location( - tz, locale=babel_locale) + try: + tz_label = babel.dates.get_timezone_location( + tz, locale=babel_locale) + except: + continue + # Translators: UTC offset and timezone label tz_name = _("%(offset)s: %(label)s") % {"offset": utc_offset, "label": tz_label} </pre> To manage notifications about this bug go to: https://bugs.launchpad.net/horizon/+bug/2085126/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp