#NEWLINE# @ login_required #NEWLINE# def update( request ) : #NEWLINE# #INDENT# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# uform = UserForm ( data = request . POST , instance = request . user ) #NEWLINE# form = UserProfileForm ( data = request . POST , instance = request . user . st ) #NEWLINE# if all ( [ uform . is_valid ( ) , form . is_valid ( ) ] ) : #NEWLINE# #INDENT# uform . save ( ) #NEWLINE# form . save ( ) #NEWLINE# messages . info ( request , _ ( 'Your profile has been updated!' ) ) #NEWLINE# return redirect ( reverse ( 'spirit:user:update' ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# uform = UserForm ( instance = request . user ) #NEWLINE# form = UserProfileForm ( instance = request . user . st ) #NEWLINE# #UNINDENT# context = { #NEWLINE# #INDENT# 'form' : form , #NEWLINE# 'uform' : uform , #NEWLINE# #UNINDENT# } #NEWLINE# return render ( request , 'spirit/user/profile_update.html' , context )