@login_required
@permission_required_or_403('forums_forum.thread_delete_forum', (Forum, 'slug__iexact', 'forum_slug'))
def delete_thread(request, forum_slug, thread_id):
 forum = get_object_or_404(Forum, slug=forum_slug)
 thread = get_object_or_404(Thread, pk=thread_id, forum=forum)
 if (request.method == 'GET'):
  return render(request, 'forums/confirm_thread_delete.html', {'forum': forum, 'thread': thread})
 log.warning(('User %s is deleting thread with id=%s' % (request.user, thread.id)))
 thread.delete()
 statsd.incr('forums.delete_thread')
 return HttpResponseRedirect(reverse('forums.threads', args=[forum_slug]))

@ login_required @ permission_required_or_403 ( 'forums_forum.thread_delete_forum' , ( Forum , 'slug__iexact' , 'forum_slug' ) ) def delete_thread ( request , forum_slug , thread_id ) : forum = get_object_or_404 ( Forum , slug = forum_slug ) thread = get_object_or_404 ( Thread , pk = thread_id , forum = forum ) if ( request . method == 'GET' ) : return render ( request , 'forums/confirm_thread_delete.html' , { 'forum' : forum , 'thread' : thread } ) log . warning ( ( 'User %s is deleting thread with id=%s' % ( request . user , thread . id ) ) ) thread . delete ( ) statsd . incr ( 'forums.delete_thread' ) return HttpResponseRedirect ( reverse ( 'forums.threads' , args = [ forum_slug ] ) )
given a course_id and thread_id .