@require_POST
@login_required
def add_check(request, code):
    project = _get_rw_project_for_user(request, code)
    if (project.num_checks_available() <= 0):
        return HttpResponseBadRequest()
    check = Check(project=project)
    check.save()
    check.assign_all_channels()
    url = reverse('hc-details', args=[check.code])
    return redirect((url + '?new'))
@require_POST
@login_required
def add_check(request, code):
    project = _get_rw_project_for_user(request, code)
    if (project.num_checks_available() <= 0):
        return HttpResponseBadRequest()
    check = Check(project=project)
    check.save()
    check.assign_all_channels()
    url = reverse('hc-details', args=[check.code])
    return redirect((url + '?new'))