config: Handle miscellaneous time zones also

- In appears that in Debian it is possible to set the timezones from one
  of the listed items in zonetab.info or addtitional timezones from the
  directory /usr/share/zoneinfo/Etc/.  Add these too.

- By default all FreedomBox images have Etc/UTC as time zone.  This is
  now properly listed.
This commit is contained in:
Sunil Mohan Adapa 2015-09-04 19:24:04 +05:30
parent b1c11b5cc7
commit da3e92312c

View File

@ -24,6 +24,7 @@ from django.contrib import messages
from django.core import validators
from django.template.response import TemplateResponse
from gettext import gettext as _
import glob
import logging
import re
import socket
@ -111,7 +112,14 @@ separated by dots.'),
pass
time_zones.sort()
return time_zones
additional_time_zones = [
path[len('/usr/share/zoneinfo/'):]
for path in glob.glob('/usr/share/zoneinfo/Etc/*')]
# Add additional time zones at the top to make them more
# noticeable because people won't look for them
return additional_time_zones + time_zones
def init():