#NEWLINE# @ login_required ( ) #NEWLINE# def password_change( req ) : #NEWLINE# #INDENT# user_to_edit = User . objects . get ( id = req . user . id ) #NEWLINE# if ( req . method == 'POST' ) : #NEWLINE# #INDENT# password_form = AdminPasswordChangeForm ( user_to_edit , req . POST ) #NEWLINE# if password_form . is_valid ( ) : #NEWLINE# #INDENT# password_form . save ( ) #NEWLINE# return HttpResponseRedirect ( '/' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# password_form = AdminPasswordChangeForm ( user_to_edit ) #NEWLINE# #UNINDENT# template_name = 'password_change.html' #NEWLINE# return render ( req , template_name , { #NEWLINE# #INDENT# 'form' : password_form , #NEWLINE# #UNINDENT# } )