@require_POST
@login_required
@permitted
def endorse_comment(request, course_id, comment_id):
 course_key = CourseKey.from_string(course_id)
 comment = cc.Comment.find(comment_id)
 user = request.user
 comment.endorsed = (request.POST.get('endorsed', 'false').lower() == 'true')
 comment.endorsement_user_id = user.id
 comment.save()
 comment_endorsed.send(sender=None, user=user, post=comment)
 return JsonResponse(prepare_content(comment.to_dict(), course_key))

@ require_POST @ login_required @ permitted def endorse_comment ( request , course_id , comment_id ) : course_key = CourseKey . from_string ( course_id ) comment = cc . Comment . find ( comment_id ) user = request . user comment . endorsed = ( request . POST . get ( 'endorsed' , 'false' ) . lower ( ) == 'true' ) comment . endorsement_user_id = user . id comment . save ( ) comment_endorsed . send ( sender = None , user = user , post = comment ) return JsonResponse ( prepare_content ( comment . to_dict ( ) , course_key ) )
given a course_id and comment_id .