def check_password(self, clear_passwd): ''' check if the given password equals the stored one ''' return self.password == hash_password(clear_passwd)
def set_password(self, clear_passwd): ''' set the password property, by hashing it with the utils.hash_password function ''' self.password = hash_password(clear_passwd)