#NEWLINE# @ login_required #NEWLINE# def delete( request ) : #NEWLINE# #INDENT# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# ( profile , created ) = Profile . objects . get_or_create ( user = request . user ) #NEWLINE# old_profile = copy . copy ( profile ) #NEWLINE# old_user = copy . copy ( request . user ) #NEWLINE# Profile . objects . filter ( user = request . user ) . delete ( ) #NEWLINE# EmailValidation . objects . filter ( user = request . user ) . delete ( ) #NEWLINE# Avatar . objects . filter ( user = request . user ) . delete ( ) #NEWLINE# request . user . email = '' #NEWLINE# request . user . first_name = '' #NEWLINE# request . user . last_name = '' #NEWLINE# request . user . save ( ) #NEWLINE# messages . add_message ( request , messages . INFO , _ ( 'Your profile information has been removed successfully.' ) ) #NEWLINE# signal_responses = signals . post_signal . send ( sender = delete , request = request , extra = { #NEWLINE# #INDENT# 'old_profile' : old_profile , #NEWLINE# 'old_user' : old_user , #NEWLINE# #UNINDENT# } ) #NEWLINE# return ( signals . last_response ( signal_responses ) or HttpResponseRedirect ( reverse ( 'profile_overview' ) ) ) #NEWLINE# #UNINDENT# template = 'userprofile/profile/delete.html' #NEWLINE# data = { #NEWLINE# #INDENT# 'section' : 'delete' , #NEWLINE# #UNINDENT# } #NEWLINE# signals . context_signal . send ( sender = delete , request = request , context = data ) #NEWLINE# return render_to_response ( template , data , context_instance = RequestContext ( request ) )