@require_setting('SLACK_CLIENT_ID')
@login_required
def add_slack_btn(request, code):
    project = _get_rw_project_for_user(request, code)
    state = token_urlsafe()
    authorize_url = ('https://slack.com/oauth/v2/authorize?' + urlencode({'scope': 'incoming-webhook', 'client_id': settings.SLACK_CLIENT_ID, 'state': state}))
    ctx = {'project': project, 'page': 'channels', 'authorize_url': authorize_url}
    request.session['add_slack'] = (state, str(project.code))
    return render(request, 'integrations/add_slack_btn.html', ctx)
@require_setting('SLACK_CLIENT_ID')
@login_required
def add_slack_btn(request, code):
    project = _get_rw_project_for_user(request, code)
    state = token_urlsafe()
    authorize_url = ('https://slack.com/oauth/v2/authorize?' + urlencode({'scope': 'incoming-webhook', 'client_id': settings.SLACK_CLIENT_ID, 'state': state}))
    ctx = {'project': project, 'page': 'channels', 'authorize_url': authorize_url}
    request.session['add_slack'] = (state, str(project.code))
    return render(request, 'integrations/add_slack_btn.html', ctx)