mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
run pre-commit
This commit is contained in:
@@ -27,7 +27,7 @@ class SessionDecoder(json.JSONDecoder):
|
||||
"""Decode json, recomposing recordsets and date/datetime"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(object_hook=self.object_hook, *args, **kwargs)
|
||||
super().__init__(*args, object_hook=self.object_hook, **kwargs)
|
||||
|
||||
def object_hook(self, obj):
|
||||
if "_type" not in obj:
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
[build-system]
|
||||
requires = ["whool"]
|
||||
build-backend = "whool.buildapi"
|
||||
@@ -40,10 +40,10 @@ class RedisSessionStore(SessionStore):
|
||||
self.anon_expiration = anon_expiration
|
||||
self.prefix = "session:"
|
||||
if prefix:
|
||||
self.prefix = "%s:%s:" % (self.prefix, prefix)
|
||||
self.prefix = f"{self.prefix}:{prefix}:"
|
||||
|
||||
def build_key(self, sid):
|
||||
return "%s%s" % (self.prefix, sid)
|
||||
return f"{self.prefix}{sid}"
|
||||
|
||||
def save(self, session):
|
||||
key = self.build_key(session.sid)
|
||||
@@ -56,7 +56,7 @@ class RedisSessionStore(SessionStore):
|
||||
expiration = session.expiration or self.anon_expiration
|
||||
if _logger.isEnabledFor(logging.DEBUG):
|
||||
if session.uid:
|
||||
user_msg = "user '%s' (id: %s)" % (session.login, session.uid)
|
||||
user_msg = f"user '{session.login}' (id: {session.uid})"
|
||||
else:
|
||||
user_msg = "anonymous user"
|
||||
_logger.debug(
|
||||
|
||||
@@ -18,4 +18,4 @@ def strtobool(value):
|
||||
try:
|
||||
return _MAP[str(value).lower()]
|
||||
except KeyError as error:
|
||||
raise ValueError('"{}" is not a valid bool value'.format(value)) from error
|
||||
raise ValueError(f'"{value}" is not a valid bool value') from error
|
||||
|
||||
Reference in New Issue
Block a user