[tryton-debian-vcs] tryton-server branch upstream updated. upstream/4.2.1-1-g6f630e5

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Tue Mar 14 12:13:37 UTC 2017


The following commit has been merged in the upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-server.git;a=commitdiff;h=upstream/4.2.1-1-g6f630e5

commit 6f630e52ed18c96797e36a1207aaf322f55143e9
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Mar 14 10:26:43 2017 +0100

    Adding upstream version 4.2.2.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/CHANGELOG b/CHANGELOG
index 5fc5c66..293edce 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 4.2.2 - 2017-03-10
+* Bug fixes (see mercurial logs for details)
+
 Version 4.2.1 - 2017-01-03
 * Bug fixes (see mercurial logs for details)
 
diff --git a/COPYRIGHT b/COPYRIGHT
index dea0462..411f7bd 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,9 +1,9 @@
 Copyright (C) 2004-2008 Tiny SPRL.
-Copyright (C) 2007-2016 Cédric Krier.
+Copyright (C) 2007-2017 Cédric Krier.
 Copyright (C) 2007-2013 Bertrand Chenal.
-Copyright (C) 2008-2016 B2CK SPRL.
+Copyright (C) 2008-2017 B2CK SPRL.
 Copyright (C) 2011 Openlabs Technologies & Consulting (P) Ltd.
-Copyright (C) 2011-2016 Nicolas Évrard.
+Copyright (C) 2011-2017 Nicolas Évrard.
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/PKG-INFO b/PKG-INFO
index f7b73b1..1fa5eed 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond
-Version: 4.2.1
+Version: 4.2.2
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/trytond.egg-info/PKG-INFO b/trytond.egg-info/PKG-INFO
index f7b73b1..1fa5eed 100644
--- a/trytond.egg-info/PKG-INFO
+++ b/trytond.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond
-Version: 4.2.1
+Version: 4.2.2
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/trytond/__init__.py b/trytond/__init__.py
index 667468b..3ab0499 100644
--- a/trytond/__init__.py
+++ b/trytond/__init__.py
@@ -5,7 +5,7 @@ import time
 import logging
 from email import charset
 
-__version__ = "4.2.1"
+__version__ = "4.2.2"
 logger = logging.getLogger(__name__)
 
 os.environ['TZ'] = 'UTC'
diff --git a/trytond/backend/mysql/database.py b/trytond/backend/mysql/database.py
index 5195e69..ab73120 100644
--- a/trytond/backend/mysql/database.py
+++ b/trytond/backend/mysql/database.py
@@ -103,7 +103,7 @@ class Database(DatabaseInterface):
             args['passwd'] = urllib.unquote_plus(uri.password)
         conn = MySQLdb.connect(**args)
         cursor = conn.cursor()
-        cursor.execute('SET time_zone = `UTC`')
+        cursor.execute('SET time_zone = "+00:00"')
         return conn
 
     def put_connection(self, connection, close=False):
diff --git a/trytond/model/fields/field.py b/trytond/model/fields/field.py
index ddacfb4..0f07729 100644
--- a/trytond/model/fields/field.py
+++ b/trytond/model/fields/field.py
@@ -123,7 +123,7 @@ def instanciate_values(Target, value):
         if isinstance(data, Target):
             return data
         elif isinstance(data, dict):
-            if data.get('id') >= 0:
+            if data.get('id', -1) >= 0:
                 values = {}
                 values.update(data)
                 values.update(kwargs)
diff --git a/trytond/protocols/jsonrpc.py b/trytond/protocols/jsonrpc.py
index 6598142..d415da9 100644
--- a/trytond/protocols/jsonrpc.py
+++ b/trytond/protocols/jsonrpc.py
@@ -154,7 +154,7 @@ class JSONProtocol:
                 response['result'] = data
         else:
             if isinstance(data, Exception):
-                return InternalServerError()
+                return InternalServerError(data)
             response = data
         return Response(json.dumps(response, cls=JSONEncoder),
             content_type='application/json')
diff --git a/trytond/protocols/wrappers.py b/trytond/protocols/wrappers.py
index ee1ac6c..ae20fe3 100644
--- a/trytond/protocols/wrappers.py
+++ b/trytond/protocols/wrappers.py
@@ -101,8 +101,7 @@ def with_pool(func):
         database_list = Pool.database_list()
         pool = Pool(database_name)
         if database_name not in database_list:
-            with Transaction().start(
-                    database_name, request.user_id, readonly=True):
+            with Transaction().start(database_name, 0, readonly=True):
                 pool.init()
         return func(request, pool, *args, **kwargs)
     return wrapper
@@ -126,7 +125,6 @@ def with_transaction(readonly=None):
                     try:
                         Cache.clean(pool.database_name)
                         result = func(request, pool, *args, **kwargs)
-                        return result
                     except DatabaseOperationalError:
                         if count and not readonly_:
                             transaction.rollback()
@@ -139,6 +137,7 @@ def with_transaction(readonly=None):
                     # Need to commit to unlock SQLite database
                     transaction.commit()
                     Cache.resets(pool.database_name)
+                return result
         return wrapper
     return decorator
 
diff --git a/trytond/wsgi.py b/trytond/wsgi.py
index bf19d6e..f767266 100644
--- a/trytond/wsgi.py
+++ b/trytond/wsgi.py
@@ -6,7 +6,7 @@ import traceback
 
 from werkzeug.wrappers import Response
 from werkzeug.routing import Map, Rule
-from werkzeug.exceptions import abort, HTTPException
+from werkzeug.exceptions import abort, HTTPException, InternalServerError
 
 import wrapt
 
@@ -82,7 +82,10 @@ class TrytondWSGI(object):
                         response = cls.response(data, request)
                         break
                 else:
-                    response = Response(data)
+                    if isinstance(data, Exception):
+                        response = InternalServerError(data)
+                    else:
+                        response = Response(data)
         else:
             response = data
         # TODO custom process response
-- 
tryton-server



More information about the tryton-debian-vcs mailing list