@require_POST
@login_required
def filtering_rules(request, code):
    check = _get_rw_check_for_user(request, code)
    form = forms.FilteringRulesForm(request.POST)
    if form.is_valid():
        check.subject = form.cleaned_data['subject']
        check.subject_fail = form.cleaned_data['subject_fail']
        check.methods = form.cleaned_data['methods']
        check.manual_resume = form.cleaned_data['manual_resume']
        check.save()
    return redirect('hc-details', code)
@require_POST
@login_required
def filtering_rules(request, code):
    check = _get_rw_check_for_user(request, code)
    form = forms.FilteringRulesForm(request.POST)
    if form.is_valid():
        check.subject = form.cleaned_data['subject']
        check.subject_fail = form.cleaned_data['subject_fail']
        check.methods = form.cleaned_data['methods']
        check.manual_resume = form.cleaned_data['manual_resume']
        check.save()
    return redirect('hc-details', code)