#NEWLINE# @ staff_member_required #NEWLINE# def delete_job( request , queue_index , job_id ) : #NEWLINE# #INDENT# queue_index = int ( queue_index ) #NEWLINE# queue = get_queue_by_index ( queue_index ) #NEWLINE# job = Job . fetch ( job_id , connection = queue . connection ) #NEWLINE# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# queue . connection . _lrem ( queue . key , 0 , job . id ) #NEWLINE# job . delete ( ) #NEWLINE# messages . info ( request , ( 'You have successfully deleted %s' % job . id ) ) #NEWLINE# return redirect ( 'rq_jobs' , queue_index ) #NEWLINE# #UNINDENT# context_data = { #NEWLINE# #INDENT# 'queue_index' : queue_index , #NEWLINE# 'job' : job , #NEWLINE# 'queue' : queue , #NEWLINE# #UNINDENT# } #NEWLINE# return render ( request , 'django_rq/delete_job.html' , context_data )