From cd6001bafd7e593cef3d90924ea794bb34cb87d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 1 Apr 2023 00:18:01 +0200 Subject: [PATCH] Clear password hash read even if there is no cache This was introduced by 2c557f1b4882 (grafted from 8ae09df296211e3517e3f485c1efbea590662a5b) --HG-- branch : 6.0 --- trytond/trytond/res/user.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/trytond/trytond/res/user.py b/trytond/trytond/res/user.py index 08ec146b59..f14aa089c7 100644 --- a/trytond/trytond/res/user.py +++ b/trytond/trytond/res/user.py @@ -362,12 +362,11 @@ class User(avatar_mixin(100, 'login'), DeactivableMixin, ModelSQL, ModelView): def read(cls, ids, fields_names): result = super(User, cls).read(ids, fields_names) cache = Transaction().get_cache().get(cls.__name__) - if cache is not None: - for values in result: - if 'password_hash' in values: - values['password_hash'] = None - if values['id'] in cache: - cache[values['id']]['password_hash'] = None + for values in result: + if 'password_hash' in values: + values['password_hash'] = None + if cache and values['id'] in cache: + cache[values['id']]['password_hash'] = None return result @classmethod