Clear password hash read even if there is no cache

This was introduced by 2c557f1b4882
(grafted from 8ae09df296211e3517e3f485c1efbea590662a5b)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier
2023-04-01 00:18:01 +02:00
parent 6cff284c1d
commit cd6001bafd
+5 -6
View File
@@ -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