#NEWLINE# @ sensitive_variables ( 'data' ) #NEWLINE# def handle( self , request , data ) : #NEWLINE# #INDENT# user_is_editable = api . keystone . keystone_can_edit_user ( ) #NEWLINE# if user_is_editable : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# api . keystone . user_update_own_password ( request , data [ 'current_password' ] , data [ 'new_password' ] ) #NEWLINE# response = http . HttpResponseRedirect ( settings . LOGOUT_URL ) #NEWLINE# msg = _ ( 'Password changed. Please log in again to continue.' ) #NEWLINE# utils . add_logout_reason ( request , response , msg ) #NEWLINE# return response #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# exceptions . handle ( request , _ ( 'Unable to change password.' ) ) #NEWLINE# return False #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# messages . error ( request , _ ( 'Changing password is not supported.' ) ) #NEWLINE# return False #NEWLINE# #UNINDENT# return True