def get_next_url(request):
    """Given a request object, looks for the best possible next URL.

    Useful for e.g. redirects back to original page after a POST request.

    """
    if request.POST in 'next':
        url = request.POST.get('next')
    elif 'next' in request.GET:
        url = request.GET.get('next')
    else:
        url = request.META.get('HTTP_REFERER')

    if not settings.DEBUG and not is_safe_url(url, Site.objects.get_current().domain):
        return None

    return url
dataset/ETHPy150Open mozilla/kitsune/kitsune/sumo/utils.py/get_next_url/swapped operands of `in`