@require_POST
@login_required
@permission_required_or_403('forums_forum.thread_sticky_forum', (Forum, 'slug__iexact', 'forum_slug'))
def sticky_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)
 thread.is_sticky = (not thread.is_sticky)
 log.info(('User %s set is_sticky=%s on thread with id=%s ' % (request.user, thread.is_sticky, thread.id)))
 thread.save()
 return HttpResponseRedirect(reverse('forums.posts', args=[forum_slug, thread_id]))

@ require_POST @ login_required @ permission_required_or_403 ( 'forums_forum.thread_sticky_forum' , ( Forum , 'slug__iexact' , 'forum_slug' ) ) def sticky_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 ) thread . is_sticky = ( not thread . is_sticky ) log . info ( ( 'User %s set is_sticky=%s on thread with id=%s ' % ( request . user , thread . is_sticky , thread . id ) ) ) thread . save ( ) return HttpResponseRedirect ( reverse ( 'forums.posts' , args = [ forum_slug , thread_id ] ) )
mark/unmark a thread sticky .