From 40d3006505ea03cb2318622dff16eb7c2e8f7213 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Thu, 28 Oct 2010 14:37:08 -0500 Subject: Reports: Fix default time zone settings (Resolves Ticket #957) We were previously defaulting to America/Chicago instead of leaving this option up to the user. Setting the default to None will cause Django to go by the system time. Note also that Django sets the os.environ['TZ'] variable when this is not none, so we want to be careful not to set that if we don't have to. Signed-off-by: Sol Jerome --- src/lib/Server/Hostbase/settings.py | 7 +++++-- src/lib/Server/Reports/settings.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib/Server/Hostbase/settings.py b/src/lib/Server/Hostbase/settings.py index dadf98d24..a42fd5b2e 100644 --- a/src/lib/Server/Hostbase/settings.py +++ b/src/lib/Server/Hostbase/settings.py @@ -44,8 +44,11 @@ DATABASE_HOST = options['database_host'] # Set to empty string for default. Not used with sqlite3. DATABASE_PORT = int(options['database_port']) # Local time zone for this installation. All choices can be found here: -# http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE -TIME_ZONE = 'America/Chicago' +# http://docs.djangoproject.com/en/dev/ref/settings/#time-zone +try: + TIME_ZONE = c.get('statistics', 'time_zone') +except: + TIME_ZONE = None # enter the defauly MX record machines will get in Hostbase # this setting may move elsewhere eventually diff --git a/src/lib/Server/Reports/settings.py b/src/lib/Server/Reports/settings.py index 81220c0e3..b725783ca 100644 --- a/src/lib/Server/Reports/settings.py +++ b/src/lib/Server/Reports/settings.py @@ -49,7 +49,7 @@ if DATABASE_ENGINE == 'sqlite3' and DATABASE_NAME == '': try: TIME_ZONE = c.get('statistics', 'time_zone') except: - TIME_ZONE = 'America/Chicago' + TIME_ZONE = None # Language code for this installation. All choices can be found here: # http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes -- cgit v1.2.3-1-g7c22