#NEWLINE# @ app . route ( '/profile/<id>/password' , methods = [ 'POST' ] ) #NEWLINE# def user_password_modify( id ) : #NEWLINE# #INDENT# current_password = request . json . get ( 'currentPassword' , None ) #NEWLINE# new_password = request . json . get ( 'newPassword' , None ) #NEWLINE# id_type = request . args . get ( 'id_type' , 'url_slug' ) #NEWLINE# try : #NEWLINE# #INDENT# if ( id_type == 'reset_token' ) : #NEWLINE# #INDENT# user = reset_password_from_token ( id , request . json [ 'newPassword' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# user = reset_password ( id , id_type , current_password , new_password ) #NEWLINE# #UNINDENT# #UNINDENT# except PasswordResetError as e : #NEWLINE# #INDENT# abort_json ( 403 , e . message ) #NEWLINE# #UNINDENT# commit ( db ) #NEWLINE# return json_resp_from_thing ( { #NEWLINE# #INDENT# 'about' : user . dict_about ( ) , #NEWLINE# #UNINDENT# } )