#NEWLINE# @ permission_required ( 'task.change_task' , ( Task , 'id' , 'task_id' ) ) #NEWLINE# def task_delete( request , task_id ) : #NEWLINE# #INDENT# if ( data . method != 'POST' ) : #NEWLINE# #INDENT# return Http404 #NEWLINE# #UNINDENT# task = get_object_or_404 ( Task , pk = task_id ) #NEWLINE# task . delete ( ) #NEWLINE# data = { #NEWLINE# #INDENT# 'status' : True , #NEWLINE# 'action' : 'redirect' , #NEWLINE# 'target' : task . application . get_absolute_url ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# return HttpResponse ( json . dumps ( data ) , content_type = 'application/json' )