#NEWLINE# @ login_required #NEWLINE# def avatardelete( request , avatar_id = False ) : #NEWLINE# #INDENT# if ( request . META . get ( 'HTTP_X_REQUESTED_WITH' ) == 'XMLHttpRequest' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# for avatar in Avatar . objects . filter ( user = request . user ) : #NEWLINE# #INDENT# avatar . delete ( ) #NEWLINE# #UNINDENT# return HttpResponse ( simplejson . dumps ( { #NEWLINE# #INDENT# 'success' : True , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return HttpResponse ( simplejson . dumps ( { #NEWLINE# #INDENT# 'success' : False , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise Http404 ( )