Managers
The PasswordHistory model has a custom manager
that has the following helper functions:
PasswordHistoryManager
- class password_policies.managers.PasswordHistoryManager(*args, **kwargs)
- delete_expired(user, offset=None)
Deletes expired password history entries from the database(s).
- change_required(user)
Checks if the user needs to change his/her password.
- check_password(user, raw_password)
Compares a raw (UNENCRYPTED!!!) password to entries in the users’s password history.
- get_newest(user)
Gets the newest password history entry.
- Parameters:
- Returns:
A
PasswordHistoryinstance if found,Noneif not.