예제 #1
0
파일: views.py 프로젝트: birdsarah/core-hq
def bootstrap(request, domain):
    if request.method == "POST":
        D = Domain.get_by_name(domain)
        if D.commtrack_enabled:
            return HttpResponse('already configured', 'text/plain')
        else:
            bootstrap_psi.one_time_setup(D)
            return HttpResponse('set up successfully', 'text/plain')

    return HttpResponse('<form method="post" action=""><button type="submit">Bootstrap Commtrack domain</button></form>')
예제 #2
0
def bootstrap(request, domain):
    if request.method == "POST":
        D = Domain.get_by_name(domain)

        if D.commtrack_enabled:
            return HttpResponse('already configured', 'text/plain')
        else:
            bootstrap_psi.one_time_setup(D)
            return HttpResponse('set up successfully', 'text/plain')

    return render(request, 'commtrack/debug/bootstrap.html', {
        'domain': domain,
    })
예제 #3
0
def bootstrap(request, domain):
    if request.method == "POST":
        D = Domain.get_by_name(domain)

        if D.commtrack_enabled:
            return HttpResponse('already configured', 'text/plain')
        else:
            bootstrap_psi.one_time_setup(D)
            return HttpResponse('set up successfully', 'text/plain')

    return render(request, 'commtrack/debug/bootstrap.html', {
        'domain': domain,
        }
    )