#NEWLINE# @ login_required #NEWLINE# def addressbook( request ) : #NEWLINE# #INDENT# profile = request . user . get_profile ( ) #NEWLINE# profile_form = ProfileForm ( ( request . POST or None ) , ( request . FILES or None ) , instance = profile , initial = { #NEWLINE# #INDENT# 'email' : request . user . email , #NEWLINE# 'first_name' : request . user . first_name , #NEWLINE# 'last_name' : request . user . last_name , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( ( request . method == 'POST' ) and profile_form . is_valid ( ) ) : #NEWLINE# #INDENT# request . user . email = profile_form . cleaned_data [ 'email' ] #NEWLINE# request . user . first_name = profile_form . cleaned_data [ 'first_name' ] #NEWLINE# request . user . last_name = profile_form . cleaned_data [ 'last_name' ] #NEWLINE# request . user . save ( ) #NEWLINE# profile_form . save ( ) #NEWLINE# return HttpResponseRedirect ( request . path ) #NEWLINE# #UNINDENT# context = { #NEWLINE# #INDENT# 'profile_form' : profile_form , #NEWLINE# 'object_list' : PipaProfile . objects . all ( ) , #NEWLINE# 'user_list' : User . objects . all ( ) . order_by ( 'username' ) , #NEWLINE# 'auth_form' : LDAPPasswordChangeForm ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# return render_to_response ( 'org/addressbook.html' , RequestContext ( request , context ) )