@require_POST
@login_required
def update_name(request, code):
    check = _get_rw_check_for_user(request, code)
    form = forms.NameTagsForm(request.POST)
    if form.is_valid():
        check.name = form.cleaned_data['name']
        check.tags = form.cleaned_data['tags']
        check.desc = form.cleaned_data['desc']
        check.save()
    if ('/details/' in request.META.get('HTTP_REFERER', '')):
        return redirect('hc-details', code)
    return redirect('hc-checks', check.project.code)
@require_POST
@login_required
def update_name(request, code):
    check = _get_rw_check_for_user(request, code)
    form = forms.NameTagsForm(request.POST)
    if form.is_valid():
        check.name = form.cleaned_data['name']
        check.tags = form.cleaned_data['tags']
        check.desc = form.cleaned_data['desc']
        check.save()
    if ('/details/' in request.META.get('HTTP_REFERER', )):
        return redirect('hc-details', code)
    return redirect('hc-checks', check.project.code)