예제 #1
0
파일: views.py 프로젝트: sfioritto/lookout
def disable(request, clientid):
    """
    Disable the given alert. A disabled alert can never be
    enabled.
    """
    if request.method == "POST":
        form = DisableAlertForm(request.POST)
        alert = get_object_or_404(Alert, pk=form.data['id'])
        alerts.disable_alert(alert.removeurl)
        alert.disabled = True
        alert.save()
        return HttpResponse()
    else:
        raise Http404
예제 #2
0
def test_disable_alert_bad_url():
    """
    Should raise errors if the url doesn't start with "/alerts".
    """
    alerts.disable_alert("")
예제 #3
0
def test_disable_alert_google_down():
    """
    The url provided returns a 404 which should raise a 404.
    """
    alerts.disable_alert("/alerts/disable/bad")