← Back to team overview

openstack team mailing list archive

Change user password (not admin)

 

Hi everyone!

I am trying to develop a new feature to horizon, I want to users can update
their own password.
I used this:

from horizon import api

api.user_update_password(
    request,
    request.user.id,
    form.cleaned_data['new_password'],
    admin=True
)

But  the user is logged out because in keystone.py there is this:

if not user.is_admin():
            raise exceptions.NotAuthorized

So, Only the user admin can use that method.

How can I be able to use this method with a normal user, or do you
recommend to query the database directly to modify the password in the user
table.

Thanks in advance!

Follow ups