code: def update_password(self, user, password, skip_validation=False):
          
          pwcol = self.options["password_column"]
          pwhash = self.bcrypt.generate_password_hash(password)
          if not skip_validation:
              self.validate_password(user, password, pwhash)
          if self.options['prevent_password_reuse']:
              user.previous_passwords = [getattr(user, pwcol)] + (user.previous_passwords or [])
              if self.options['max_password_reuse_saved']:
                  user.previous_passwords = user.previous_passwords[:self.options['max_password_reuse_saved']]
          setattr(user, pwcol, pwhash)
          user.last_password_change_at = datetime.datetime.utcnow()
          user.must_reset_password_at_login = False
docs: Updates the password of a user