예제 #1
0
파일: views.py 프로젝트: joliotchu/freenas
def directoryservice_idmap_ldap(request, id):
    idmap_ldap = models.idmap_ldap.objects.get(id=id)

    if request.method == "POST":
        form = forms.idmap_ldap_Form(request.POST, instance=idmap_ldap)
        if form.is_valid():
            form.save()
            return JsonResp(request, message="Idmap ldap successfully edited.")
        else:
            return JsonResp(request, form=form)
    else:
        form = forms.idmap_ldap_Form(instance=idmap_ldap)

    return render(request, 'directoryservice/idmap_ldap.html', {'form': form})
예제 #2
0
파일: views.py 프로젝트: Cbrdiv/freenas
def directoryservice_idmap_ldap(request, id):
    idmap_ldap = models.idmap_ldap.objects.get(id=id)

    if request.method == "POST":
        form = forms.idmap_ldap_Form(request.POST, instance=idmap_ldap)
        if form.is_valid(): 
            form.save()
            return JsonResp(
                request,
                message="Idmap ldap successfully edited."
            )
        else:
            return JsonResp(request, form=form)
    else:
        form = forms.idmap_ldap_Form(instance=idmap_ldap)

    return render(request, 'directoryservice/idmap_ldap.html', {
        'form': form
    })