-
-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] password_security: Set password update date for already existin…
…g users that don't have it. This fixes the password expiration date and other validations that require an existing value for password update date. [IMP] password_security: Simplify validation on password reset.
- Loading branch information
1 parent
99d7b5c
commit dfeb26a
Showing
5 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2024 Vauxoo | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
|
||
def post_init_hook(cr, registry): | ||
# Set password date for already existing users | ||
cr.execute( | ||
""" | ||
UPDATE | ||
res_users | ||
SET | ||
password_write_date = NOW() at time zone 'UTC' | ||
WHERE | ||
password_write_date IS NULL; | ||
""" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
def migrate(cr, version): | ||
# Set password date for already existing users | ||
cr.execute( | ||
""" | ||
UPDATE | ||
res_users | ||
SET | ||
password_write_date = NOW() at time zone 'UTC' | ||
WHERE | ||
password_write_date IS NULL; | ||
""" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters