From 4c206962e9daf268914a70fde705140a37e15c0f Mon Sep 17 00:00:00 2001 From: MuK IT GmbH Date: Tue, 19 Feb 2019 14:37:07 +0000 Subject: [PATCH] publish muk_session_store - 12.0 --- muk_session_store/__manifest__.py | 2 +- muk_session_store/store/postgres.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/muk_session_store/__manifest__.py b/muk_session_store/__manifest__.py index a6d9575..0ef3941 100644 --- a/muk_session_store/__manifest__.py +++ b/muk_session_store/__manifest__.py @@ -20,7 +20,7 @@ { "name": "MuK Session Store", "summary": """Session Store Options""", - "version": "12.0.1.0.6", + "version": "12.0.1.0.7", "category": "Extra Tools", "license": "AGPL-3", "website": "http://www.mukit.at", diff --git a/muk_session_store/store/postgres.py b/muk_session_store/store/postgres.py index 3daa827..7aaf464 100644 --- a/muk_session_store/store/postgres.py +++ b/muk_session_store/store/postgres.py @@ -89,7 +89,7 @@ class PostgresSessionStore(SessionStore): @retry_database def save(self, session): - with open_cursor() as cursor: + with self.open_cursor() as cursor: cursor.execute(""" INSERT INTO sessions (sid, write_date, payload) VALUES (%(sid)s, now() at time zone 'UTC', %(payload)s) @@ -99,14 +99,14 @@ class PostgresSessionStore(SessionStore): @retry_database def delete(self, session): - with open_cursor() as cursor: + with self.open_cursor() as cursor: cursor.execute("DELETE FROM sessions WHERE sid=%s;", [session.sid]) @retry_database def get(self, sid): if not self.is_valid_key(sid): return self.new() - with open_cursor() as cursor: + with self.open_cursor() as cursor: cursor.execute(""" SELECT payload, write_date FROM sessions WHERE sid=%s; @@ -125,13 +125,13 @@ class PostgresSessionStore(SessionStore): @retry_database def list(self): - with open_cursor() as cursor: + with self.open_cursor() as cursor: cursor.execute("SELECT sid FROM sessions;") return [record[0] for record in cursor.fetchall()] @retry_database def clean(self): - with open_cursor() as cursor: + with self.open_cursor() as cursor: cursor.execute(""" DELETE FROM sessions WHERE now() at time zone 'UTC' - write_date > '7 days';