#NEWLINE# @ login_required #NEWLINE# def personal( request ) : #NEWLINE# #INDENT# '\n    Personal data of the user profile\n    ' #NEWLINE# ( profile , created ) = Profile . objects . get_or_create ( user = request . user ) #NEWLINE# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# old_profile = copy . copy ( profile ) #NEWLINE# form = ProfileForm ( request . POST , instance = profile ) #NEWLINE# if form . is_valid ( ) : #NEWLINE# #INDENT# form . save ( ) #NEWLINE# messages . add_message ( request , messages . INFO , _ ( 'Your profile information has been updated successfully.' ) ) #NEWLINE# signal_responses = signals . post_signal . send ( sender = personal , request = request , form = form , extra = { #NEWLINE# #INDENT# 'old_profile' : old_profile , #NEWLINE# #UNINDENT# } ) #NEWLINE# last_reponse = signals . last_response ( signal_responses ) #NEWLINE# if last_reponse : #NEWLINE# #INDENT# return last_response #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# form = ProfileForm ( instance = profile ) #NEWLINE# #UNINDENT# template = 'userprofile/profile/personal.html' #NEWLINE# data = { #NEWLINE# #INDENT# 'section' : 'personal' , #NEWLINE# 'GOOGLE_MAPS_API_KEY' : GOOGLE_MAPS_API_KEY , #NEWLINE# 'form' : form , #NEWLINE# #UNINDENT# } #NEWLINE# signals . context_signal . send ( sender = personal , request = request , context = data ) #NEWLINE# return render_to_response ( template , data , context_instance = RequestContext ( request ) )