@require_POST
@login_required
def update_channel_name(request, code):
    channel = _get_rw_channel_for_user(request, code)
    form = forms.ChannelNameForm(request.POST)
    if form.is_valid():
        channel.name = form.cleaned_data['name']
        channel.save()
    return redirect('hc-channels', channel.project.code)
@require_POST
@login_required
def update_channel_name(request, code):
    channel = _get_rw_channel_for_user(request, code)
    form = forms.ChannelNameForm(request.POST)
    if form.is_valid():
        channel.name = form.cleaned_data['name']
        channel.save()
    return redirect('hc-channels', channel.project.code)