#NEWLINE# @ sensitive_post_parameters_m #NEWLINE# def user_change_password( self , request , id , form_url = '' ) : #NEWLINE# #INDENT# if ( not self . has_change_permission ( request ) ) : #NEWLINE# #INDENT# raise PermissionDenied #NEWLINE# #UNINDENT# user = get_object_or_404 ( self . get_queryset ( request ) , pk = id ) #NEWLINE# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# form = self . change_password_form ( user , request . POST ) #NEWLINE# if form . is_valid ( ) : #NEWLINE# #INDENT# form . save ( ) #NEWLINE# change_message = self . construct_change_message ( request , form , None ) #NEWLINE# self . log_change ( request , user , change_message ) #NEWLINE# msg = ugettext ( 'Password changed successfully.' ) #NEWLINE# messages . success ( request , msg ) #NEWLINE# return HttpResponseRedirect ( '..' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# form = self . change_password_form ( user ) #NEWLINE# #UNINDENT# fieldsets = [ ( None , { #NEWLINE# #INDENT# 'fields' : list ( form . base_fields ) , #NEWLINE# #UNINDENT# } ) ] #NEWLINE# adminForm = admin . helpers . AdminForm ( form , fieldsets , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# context = { #NEWLINE# #INDENT# 'title' : ( _ ( 'Change password: %s' ) % escape ( user . get_username ( ) ) ) , #NEWLINE# 'adminForm' : adminForm , #NEWLINE# 'form_url' : form_url , #NEWLINE# 'form' : form , #NEWLINE# 'is_popup' : ( IS_POPUP_VAR in request . REQUEST ) , #NEWLINE# 'add' : True , #NEWLINE# 'change' : False , #NEWLINE# 'has_delete_permission' : False , #NEWLINE# 'has_change_permission' : True , #NEWLINE# 'has_absolute_url' : False , #NEWLINE# 'opts' : self . model . _meta , #NEWLINE# 'original' : user , #NEWLINE# 'save_as' : False , #NEWLINE# 'show_save' : True , #NEWLINE# #UNINDENT# } #NEWLINE# return TemplateResponse ( request , ( self . change_user_password_template or 'admin/auth/user/change_password.html' ) , context , current_app = self . admin_site . name )