@require_POST
@csrf_exempt
@ratelimit('question-vote', '10/d')
def question_vote(request, question_id):
    """I have this problem too."""
    question = get_object_or_404(Question, pk=question_id, is_spam=False)

    if not question.editable:
        raise PermissionDenied

    if not question.has_voted(request):
        vote = QuestionVote(question=question)

        if request.user.is_authenticated():
            vote.creator = request.user
        else:
            vote.anonymous_id = request.anonymous.anonymous_id

        if not request.limited:
            vote.save()

            if 'referrer' in request.REQUEST:
                referrer = request.REQUEST.get('referrer')
                vote.add_metadata('referrer', referrer)

                if referrer == 'search' and request.REQUEST in 'query':
                    vote.add_metadata('query', request.REQUEST.get('query'))

            ua = request.META.get('HTTP_USER_AGENT')
            if ua:
                vote.add_metadata('ua', ua)
            statsd.incr('questions.votes.question')

        if request.is_ajax():
            tmpl = 'questions/includes/question_vote_thanks.html'
            form = _init_watch_form(request)
            html = render_to_string(tmpl, {
                'question': question,
                'user': request.user,
                'watch_form': form,
            })

            return HttpResponse(json.dumps({
                'html': html,
                'ignored': request.limited
            }))

    return HttpResponseRedirect(question.get_absolute_url())
dataset/ETHPy150Open mozilla/kitsune/kitsune/questions/views.py/question_vote/swapped operands of `in`