@require_POST
@csrf_exempt
@cross_domain_post_response
@host_check
def dislike_comment(request, comment_id):
    try:
        comment = Comment.objects.get(id=comment_id)
    except Comment.DoesNotExist as e:
        data = {'placement': 'comments_container', 'content': str(e)}
        return HttpResponseNotFound(json.dumps(data))

    if request.user.is_anonymous():
        site_admin = False
    else:
        site_admin = bool(request.user.get_comments(comment_id))

    if site_admin:
        if request.user.hidden.filter(id=comment.thread.site.id):
            return HttpResponseBadRequest(
                _('user is disabled on site with id %s') % comment.thread.site.id
            )

    liked_comments = request.session.get('liked_comments', [])
    disliked_comments = request.session.get('disliked_comments', [])

    if comment.id in liked_comments:
        comment.undo_like(request.user)
        remove_from_session_list(request, 'liked_comments', comment.id)
        comment.dislike(request.user)
        add_to_session_list(request, 'disliked_comments', comment.id)

    elif comment.id not in disliked_comments:
        comment.dislike(request.user)
        add_to_session_list(request, 'disliked_comments', comment.id)

    comments = Comment.objects.filter(thread=comment.thread)
    posted_comments = request.session.get('posted_comments', [])

    site = comment.thread.site

    resp = render(
        request,
        'comments.html',
        {
            'comments': comments,
            'posted_comments': posted_comments,
            'last_posted_comment_id': posted_comments[-1] if posted_comments else None,
            'rs_customer_id': site.rs_customer_id,
            'all_comments': request.session.get('all_comments', False),
            'site_admin': site_admin,
        }
    )
    data = {'placement': 'comments_container', 'content': resp.content}

    return HttpResponse(json.dumps(data))
dataset/ETHPy150Open c4all/c4all/comments/views.py/dislike_comment/original