[IMP]:add logger warning to notify the user for incorrect timezone value in config

bzr revid: nch@tinyerp.com-20110506103053-egt8eh85knkd3mg0
This commit is contained in:
Naresh (OpenERP)
2011-05-06 16:00:53 +05:30
parent 89af288c3b
commit 418f8b2cbc
+2
View File
@@ -1285,6 +1285,8 @@ def get_server_timezone():
# timezone detection is safe in multithread, so lazy init is ok here
if config['timezone'] and \
not isinstance(config['timezone'], basestring):
loglevels.Logger().notifyChannel("detect_server_timezone", loglevels.LOG_WARNING,
"Invalid timezone value in configuration or environment: %r, using UTC instead. Please fix this in your configuration" %(config['timezone']))
return 'UTC'
if (not config['timezone']):
config['timezone'] = detect_server_timezone()