def survey_check_vote(request, survey):
    sess_jv = request.session.get(polls_settings.SURVEY_JUST_VOTED_COOKIE_NAME, [])
    # removing just voted info from session
    if survey.id in sess_jv:
        del request.session[polls_settings.SURVEY_JUST_VOTED_COOKIE_NAME]
        # TODO - del just my poll, not the entire list !
        return polls_settings.USER_JUST_VOTED
    # removing no vote info from session
    sess_nv = request.session.get(polls_settings.SURVEY_NO_CHOICE_COOKIE_NAME, [])
    if survey.id in sess_nv:
        del request.session[polls_settings.SURVEY_NO_CHOICE_COOKIE_NAME]
        # TODO - del just my poll, not the entire list !
        return polls_settings.USER_NO_CHOICE
    # authenticated user - check session
    if request.user.is_authenticated():
        sess = request.session.get(polls_settings.SURVEY_COOKIE_NAME, [])
        if survey.id in sess:
            return polls_settings.USER_ALLREADY_VOTED
        # otherwise check Vote object - just for sure
        if survey.check_vote_by_user(request.user):
            return polls_settings.USER_ALLREADY_VOTED
        return polls_settings.USER_NOT_YET_VOTED
    # anonymous - check cookie
    else:
        cook = request.COOKIES.get(polls_settings.SURVEY_COOKIE_NAME, '').split(',')
        if str(survey.id) in cook:
            return polls_settings.USER_ALLREADY_VOTED
        ip_address = request.META['REMOTE_ADDR']
        # otherwise check Vote object - just for sure
        if survey.check_vote_by_ip_address(ip_address):
            return polls_settings.USER_ALLREADY_VOTED
        return polls_settings.USER_NOT_YET_VOTED