'Helper method to change password on user and record in the PasswordHistory'

def _change_password(self, user, password):

    user.set_password(password)
    user.save()
    history = PasswordHistory()
    history.create(user)
