erp5_authentication_policy: Do not cache password expiration state.
Caching in authentication-related work is not a good idea. Also, simplify the resulting script: - do not load Password Event from ZODB, just use the creation_date found by catalog - reorder accesses to only do them when they are needed (ex: preferences) - factorise access to persistent objects (portal_preferences) - fix coding style: space after comma, no space around named-argument equal signs, 2-spaces indentation, spaces around multiplication and division operators, upper-case pseudo-constant - factorise now vs. expire_date comparison, getting rid of the mishandled "now == expire_date" edge case in original code - remove commented-out code and obvious comments - DateTime is already implicitly bound in any script's globals, no need to explicitly import it. In turn, this allows removing immediate reindexation on corresponding scripts, as immediate reindexation will be disallowed for restricted python.
Showing
Please register or sign in to comment