예제 #1
0
def edit_auth(request, uuid):
    """
    add auth
    :param request:
    :return:
    """
    uuid = str(uuid)
    group_uuid = auth_group.objects.get(uuid=uuid)
    if request.method == 'POST':
        uf = cmdb_from(request.POST, instance=group_uuid)
        if uf.is_valid():
            uf.save()
            return HttpResponse(
                json.dumps(
                    {
                        "status": 200,
                        "msg": "ok"
                    },
                    ensure_ascii=False,
                    indent=4,
                ))

    else:
        data = cmdb_from(instance=group_uuid)

    return render_to_response('auth/jquery_from.html',
                              locals(),
                              context_instance=RequestContext(request))
예제 #2
0
파일: views.py 프로젝트: voilet/cmdb
def cmdb_auth(request):
    data = cmdb_from()
    if request.method == 'POST':
        uf = cmdb_from(request.POST)
        if uf.is_valid():
            uf.save()

            return HttpResponseRedirect("/auth/cmdb/")
        return render_to_response('auth/cmdb.html', locals(), context_instance=RequestContext(request))
    else:

        return render_to_response('auth/cmdb.html', locals(), context_instance=RequestContext(request))
예제 #3
0
def cmdb_auth(request):
    data = cmdb_from()
    if request.method == 'POST':
        uf = cmdb_from(request.POST)
        if uf.is_valid():
            uf.save()

            return HttpResponseRedirect("/auth/cmdb/")
        return render_to_response('auth/cmdb.html',
                                  locals(),
                                  context_instance=RequestContext(request))
    else:

        return render_to_response('auth/cmdb.html',
                                  locals(),
                                  context_instance=RequestContext(request))
예제 #4
0
파일: views.py 프로젝트: voilet/cmdb
def edit_auth(request, uuid):
    """
    add auth
    :param request:
    :return:
    """
    uuid = str(uuid)
    group_uuid = auth_group.objects.get(uuid=uuid)
    if request.method == 'POST':
        uf = cmdb_from(request.POST, instance=group_uuid)
        if uf.is_valid():
            uf.save()
            return HttpResponse(json.dumps({"status": 200, "msg": "ok"}, ensure_ascii=False, indent=4, ))

    else:
        data = cmdb_from(instance=group_uuid)

    return render_to_response('auth/jquery_from.html', locals(), context_instance=RequestContext(request))