Cédric Krier pushed to branch branch/default at Tryton / Tryton


Commits:
8ae09df2 by Cédric Krier at 2023-04-01T00:18:01+02:00
Clear password hash read even if there is no cache

This was introduced by 2c557f1b4882
- - - - -


1 changed file:

- trytond/trytond/res/user.py


Changes:

=====================================
trytond/trytond/res/user.py
=====================================
@@ -365,12 +365,11 @@
     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



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/8ae09df296211e3517e3f485c1efbea590662a5b

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/8ae09df296211e3517e3f485c1efbea590662a5b
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to