<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Guillermo Alvarado</b> <span dir="ltr"><<a href="mailto:stallion.ak47@gmail.com">stallion.ak47@gmail.com</a>></span><br>
Date: 2012/6/6<br>Subject: [Openstack] Change user password (not admin)<br>To: <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br><br><br>Hi everyone!<div><br></div><div>I am trying to develop a new feature to horizon, I want to users can update their own password.</div>
<div>I used this:</div><div><br></div><div><div>from horizon import api</div></div><div><br>
</div><div><div>api.user_update_password(</div><div> request,</div><div> <a href="http://request.user.id" target="_blank">request.user.id</a>,</div><div> form.cleaned_data['new_password'],</div><div> admin=True</div>
<div>
)</div></div><div><br></div><div>But the user is logged out because in keystone.py there is this: </div><div><br></div><div><div>if not user.is_admin():</div><div> raise exceptions.NotAuthorized</div></div><div>
<br></div><div>So, Only the user admin can use that method.</div><div><br></div><div>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.</div>
<div><br></div><div>Thanks in advance!</div>
</div><br><br clear="all"><div><br></div>-- <br><div>_______________________________________________________________________</div><div><b><br></b></div><div><b>Guillermo Alvarado</b></div><div><ul><li><b>5549875287</b></li>
<li><b>3521068834</b></li><li><b>92*16338*37</b></li></ul></div><div><b>Visita: <a href="http://galvarado.com.mx" target="_blank">http://galvarado.com.mx</a></b></div><br>