From 915196e3bd801c0283dd9db15e098e227f5e3d67 Mon Sep 17 00:00:00 2001 From: cfs Date: Tue, 26 Feb 2019 21:43:31 +0100 Subject: [PATCH] typos in http.py redis name clash --- muk_session_store/patch/http.py | 8 ++++---- muk_session_store/store/redis.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/muk_session_store/patch/http.py b/muk_session_store/patch/http.py index 7518367..0e4c4f3 100644 --- a/muk_session_store/patch/http.py +++ b/muk_session_store/patch/http.py @@ -25,8 +25,8 @@ from odoo.http import request from odoo.tools.func import lazy_property from odoo.addons.muk_utils.tools.patch import monkey_patch -from odoo.addons.muk_session_store.store import postgres -from odoo.addons.muk_session_store.store import redis +from odoo.addons.muk_session_store.store.postgres import PostgresSessionStore +from odoo.addons.muk_session_store.store.redis import RedisSessionStore _logger = logging.getLogger(__name__) @@ -79,9 +79,9 @@ class Root(http.Root): @lazy_property def session_store(self): if tools.config.get('session_store_database'): - return postgres.PostgresSessionStore(session_class=http.OpenERPSession) + return PostgresSessionStore(session_class=http.OpenERPSession) elif tools.config.get('session_store_redis') and redis: - return redis.RedisSessionStore(session_class=http.OpenERPSession) + return RedisSessionStore(session_class=http.OpenERPSession) return super(Root, self).session_store http.root = Root() diff --git a/muk_session_store/store/redis.py b/muk_session_store/store/redis.py index c81597a..b2d1aef 100644 --- a/muk_session_store/store/redis.py +++ b/muk_session_store/store/redis.py @@ -59,11 +59,11 @@ class RedisSessionStore(SessionStore): password=config.get('session_store_pass', None) ) - def _encode_session_key(self, kex): + def _encode_session_key(self, key): return key.encode('utf-8') if isinstance(key, str) else key def _get_session_key(self, sid): - return self._encode_session_key(self.key_prefix + sid) + return self._encode_session_key(self.prefix + sid) @retry_redis def save(self, session):