details:   https://code.tryton.org/tryton/commit/e156432714ee
branch:    default
user:      Cédric Krier <[email protected]>
date:      Fri Oct 31 12:11:02 2025 +0100
description:
        Set TRYTOND_APPNAME and TRYTOND_TZ only if they are not set or empty

        Closes #14322
diffstat:

 trytond/trytond/__init__.py |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (19 lines):

diff -r ebb9b6ac6341 -r e156432714ee trytond/trytond/__init__.py
--- a/trytond/trytond/__init__.py       Fri Oct 31 11:45:54 2025 +0100
+++ b/trytond/trytond/__init__.py       Fri Oct 31 12:11:02 2025 +0100
@@ -18,10 +18,11 @@
 __version__ = "7.7.0"
 __series__ = '.'.join(__version__.split('.')[:2])
 
-os.environ.setdefault(
-    'TRYTOND_APPNAME',
-    os.path.basename(getattr(__main__, '__file__', 'trytond')))
-os.environ['TRYTOND_TZ'] = os.environ.get('TZ') or 'UTC'
+if not os.environ.get('TRYTOND_APPNAME'):
+    os.environ['TRYTOND_APPNAME'] = os.path.basename(
+        getattr(__main__, '__file__', 'trytond'))
+if not os.environ.get('TRYTOND_TZ'):
+    os.environ['TRYTOND_TZ'] = os.environ.get('TZ') or 'UTC'
 os.environ['TZ'] = 'UTC'
 if hasattr(time, 'tzset'):
     time.tzset()

Reply via email to