Patchwork [bitbake-devel,94/94] bitbake: webhob: do not set timezones

login
register
mail settings
Submitter Alexandru DAMIAN
Date Sept. 24, 2013, 4:53 p.m.
Message ID <9b35cc5e33eff429612f8274dfed5aec02129313.1380041477.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/58809/
State New
Headers show

Comments

Alexandru DAMIAN - Sept. 24, 2013, 4:53 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

Preventing webhob setting a default timezone.
As such, it will always use the current time
for the local computer.

[YOCTO #5186]

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 bitbake/lib/webhob/whbmain/settings.py | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

Patch

diff --git a/bitbake/lib/webhob/whbmain/settings.py b/bitbake/lib/webhob/whbmain/settings.py
index d470328..c5222e5 100644
--- a/bitbake/lib/webhob/whbmain/settings.py
+++ b/bitbake/lib/webhob/whbmain/settings.py
@@ -20,16 +20,6 @@  DATABASES = {
     }
 }
 
-# If we're using sqlite, we need to tweak the performance a bit
-from django.db.backends.signals import connection_created
-def activate_synchronous_off(sender, connection, **kwargs):
-    if connection.vendor == 'sqlite':
-        cursor = connection.cursor()
-        cursor.execute('PRAGMA synchronous = 0;')
-connection_created.connect(activate_synchronous_off)
-#
-
-
 # Hosts/domain names that are valid for this site; required if DEBUG is False
 # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
 ALLOWED_HOSTS = []
@@ -38,7 +28,9 @@  ALLOWED_HOSTS = []
 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
 # although not all choices may be available on all operating systems.
 # In a Windows environment this must be set to your system time zone.
-TIME_ZONE = 'America/Chicago'
+
+# Always use local computer's time zone
+TIME_ZONE = ''
 
 # Language code for this installation. All choices can be found here:
 # http://www.i18nguy.com/unicode/language-identifiers.html
@@ -54,6 +46,7 @@  USE_I18N = True
 # calendars according to the current locale.
 USE_L10N = True
 
+
 # If you set this to False, Django will not use timezone-aware datetimes.
 USE_TZ = True
 
@@ -167,3 +160,14 @@  LOGGING = {
         },
     }
 }
+
+# If we're using sqlite, we need to tweak the performance a bit
+from django.db.backends.signals import connection_created
+def activate_synchronous_off(sender, connection, **kwargs):
+    if connection.vendor == 'sqlite':
+        cursor = connection.cursor()
+        cursor.execute('PRAGMA synchronous = 0;')
+connection_created.connect(activate_synchronous_off)
+#
+
+