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):