def register_account_current_time_zone(request): if len(get_available_admin_time_zones()) > 1: return { 'url': reverse('wagtailadmin_account_current_time_zone'), 'label': _('Current Time Zone'), 'help_text': _('Choose your current time zone.'), }
def test_available_admin_time_zones_with_permitted_time_zones(self): self.assertListEqual(get_available_admin_time_zones(), ['Africa/Addis_Ababa', 'America/Argentina/Buenos_Aires'])
def test_available_admin_time_zones_by_default(self): self.assertListEqual(get_available_admin_time_zones(), pytz.common_timezones)
def _get_time_zone_choices(): time_zones = [(tz, str(l18n.tz_fullnames.get(tz, tz))) for tz in get_available_admin_time_zones()] time_zones.sort(key=itemgetter(1)) return BLANK_CHOICE_DASH + time_zones