

@login_required
def add_vote(request, suggestion_id):
    suggestion = Suggestion.objects.get(pk=suggestion_id)
    did_vote = suggestion.rating.get_rating_for_user(request.user, request.META['REMOTE_ADDR'])
    if (did_vote == None):
        suggestion.rating.add(score=1, user=did_vote.user, ip_address=request.META['REMOTE_ADDR'])
    return HttpResponseRedirect('../../')

dataset/ETHPy150Open azavea/Open-Data-Catalog/OpenDataCatalog/suggestions/views.py add_vote/VarMisuse@69/92 `request`->`did_vote`