Merge pull request #33 from yvaucher/fix-check-session_token

Fix session check crash due to odoo recent change [1]
This commit is contained in:
Yannick Vaucher authored and GitHub committed 2018-04-09 14:41:35 +02:00
commit 43bbbe9822
4 files changed
+22 -1

No files matched your search

+1
View File
@@ -2,3 +2,4 @@
from . import http
from . import session
from . import models
+1 -1
View File
@@ -5,7 +5,7 @@
{'name': 'Sessions in Redis',
'summary': 'Store web sessions in Redis',
'version': '10.0.1.0.0',
'version': '10.0.1.0.1',
'author': 'Camptocamp,Odoo Community Association (OCA)',
'license': 'AGPL-3',
'category': 'Extra Tools',
+1
View File
@@ -0,0 +1 @@
from . import user
+19
View File
@@ -0,0 +1,19 @@
from odoo import models, tools
class User(models.Model):
_inherit = 'res.users'
@tools.ormcache('sid')
def _compute_session_token(self, sid):
"""Make sure to return an unicode string.
Odoo creates a session token using hexdigest Session which is str
but with redis we set the token from a dictionary of values passing
it in json format. When dumping values from json, we always get unicode
thus both are incompatible.
The shortest path is to fix the output of the computed session by Odoo.
"""
return unicode(super(User, self)._compute_session_token(sid))
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.