← Back to team overview

openstack team mailing list archive

Change user password (not admin)

 

---------- Forwarded message ----------
From: Guillermo Alvarado <stallion.ak47@xxxxxxxxx>
Date: 2012/6/6
Subject: [Openstack] Change user password (not admin)
To: openstack@xxxxxxxxxxxxxxxxxxx


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!



-- 
_______________________________________________________________________
*
*
*Guillermo Alvarado*

   - *5549875287*
   - *3521068834*
   - *92*16338*37*

*Visita: http://galvarado.com.mx*

References