session_db: cosmetics

pull/2550/head
Stéphane Bidoul 2023-02-10 19:21:10 +01:00
parent 8023bff1b6
commit b13029ab08
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,6 @@ class PGSessionStore(sessions.SessionStore):
@with_lock
def _open_connection(self):
cnx = odoo.sql_db.db_connect(self._uri, allow_uri=True)
try:
# return cursor to the pool
if self._cr is not None:
@ -77,6 +76,7 @@ class PGSessionStore(sessions.SessionStore):
self._cr = None
except Exception: # pylint: disable=except-pass
pass
cnx = odoo.sql_db.db_connect(self._uri, allow_uri=True)
self._cr = cnx.cursor()
self._cr._cnx.autocommit = True