@require_POST
@login_required
def post_preview_async(request, document_slug):
 statsd.incr('forums.preview')
 post = Post(creator=request.user, content=request.POST.get('content', ''))
 return render(request, 'kbforums/includes/post_preview.html', {'post_preview': post})

@ require_POST @ login_required def post_preview_async ( request , document_slug ) : statsd . incr ( 'forums.preview' ) post = Post ( creator = request . user , content = request . POST . get ( 'content' , '' ) ) return render ( request , 'kbforums/includes/post_preview.html' , { 'post_preview' : post } )
ajax preview of posts .