mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 02:08:36 +00:00
[FIX] session_redis: fix flake8 errors
This commit is contained in:
committed by
Paul
co-authored by
Paul
parent
9ac4d26470
commit
c18e84a3bf
@@ -78,15 +78,15 @@ def purge_fs_sessions(path):
|
|||||||
|
|
||||||
def copy_fs_sessions(path):
|
def copy_fs_sessions(path):
|
||||||
from odoo.http import OpenERPSession
|
from odoo.http import OpenERPSession
|
||||||
import werkzeug.contrib.sessions
|
from werkzeug.contrib.sessions import FilesystemSessionStore
|
||||||
werkzeug_session_store = werkzeug.contrib.sessions.FilesystemSessionStore(path, session_class=OpenERPSession)
|
werkzeug_session_store = FilesystemSessionStore(path, session_class=OpenERPSession)
|
||||||
session_store = http.Root().session_store
|
session_store = http.Root().session_store
|
||||||
filename_prefix='werkzeug_'
|
filename_prefix_len = len('werkzeug_')
|
||||||
filename_suffix = '.sess'
|
filename_suffix_len = len('.sess')
|
||||||
|
|
||||||
for fname in os.listdir(path):
|
for fname in os.listdir(path):
|
||||||
path = os.path.join(path, fname)
|
session_file = fname[filename_prefix_len:filename_suffix_len * -1]
|
||||||
session = werkzeug_session_store.get(fname[len(filename_prefix):len(filename_suffix) * -1])
|
session = werkzeug_session_store.get(session_file)
|
||||||
session_store.save(session)
|
session_store.save(session)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user