#NEWLINE# @ login_required ( ) #NEWLINE# def user_settings_profile( request ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# form = FormsForm . objects . get ( slug = settings . ZORNA_USER_PROFILE_FORM ) #NEWLINE# try : #NEWLINE# #INDENT# entry = form . entries . get ( account = request . user ) #NEWLINE# #UNINDENT# except FormsFormEntry . DoesNotExist : #NEWLINE# #INDENT# entry = None #NEWLINE# #UNINDENT# args = ( form , ( request . POST or None ) , ( request . FILES or None ) ) #NEWLINE# form_for_form = FormForForm ( * args , instance = ( entry or None ) ) #NEWLINE# if form . bind_to_account : #NEWLINE# #INDENT# if ( not form_for_form . instance . id ) : #NEWLINE# #INDENT# del form_for_form . fields [ 'zorna_owner' ] #NEWLINE# del form_for_form . fields [ 'zorna_owner-id' ] #NEWLINE# form_for_form . fields [ 'zorna_owner-id' ] = forms . CharField ( widget = forms . HiddenInput ( ) , initial = request . user . pk ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# del form_for_form . fields [ 'zorna_owner' ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# form_for_form = None #NEWLINE# form = None #NEWLINE# #UNINDENT# if ( form_for_form and ( request . method == 'POST' ) and form_for_form . is_valid ( ) ) : #NEWLINE# #INDENT# form_for_form . save ( request = request ) #NEWLINE# return user_settings ( request ) #NEWLINE# #UNINDENT# extra_context = user_settings_intialize ( request ) #NEWLINE# extra_context [ 'form_for_form' ] = form_for_form #NEWLINE# extra_context [ 'form' ] = form #NEWLINE# context = RequestContext ( request ) #NEWLINE# return render_to_response ( 'account/user_profile.html' , extra_context , context_instance = form )