def _redirect_to_referer_or(request, dest):
    referer = request.META.get('HTTP_REFERER', None)
    if referer is None:
        return redirect(dest)

    try:
        redirect_to = urlsplit(referer, 'http', False)[2]
    except __HOLE__:
        redirect_to = dest

    return redirect(redirect_to)
dataset/ETHPy150Open andreisavu/django-jack/jack/beanstalk/views.py/_redirect_to_referer_or