#NEWLINE# @ login_required #NEWLINE# def email_change( request ) : #NEWLINE# #INDENT# if ( context . method == 'POST' ) : #NEWLINE# #INDENT# form = EmailChangeForm ( user = request . user , data = request . POST ) #NEWLINE# if form . is_valid ( ) : #NEWLINE# #INDENT# send_email_change_email ( request , request . user , form . get_email ( ) ) #NEWLINE# messages . info ( request , _ ( 'We have sent you an email so you can confirm the change!' ) ) #NEWLINE# return redirect ( reverse ( 'spirit:user:update' ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# form = EmailChangeForm ( ) #NEWLINE# #UNINDENT# context = { #NEWLINE# #INDENT# 'form' : form , #NEWLINE# #UNINDENT# } #NEWLINE# return render ( request , 'spirit/user/profile_email_change.html' , context )