Exemplo n.º 1
0
def directoryservice_idmap_nss(request, id):
    idmap_nss = models.idmap_nss.objects.get(id=id)

    if request.method == "POST":
        form = forms.idmap_nss_Form(request.POST, instance=idmap_nss)
        if form.is_valid():
            form.save()
            return JsonResp(request, message="Idmap nss successfully edited.")
        else:
            return JsonResp(request, form=form)
    else:
        form = forms.idmap_nss_Form(instance=idmap_nss)

    return render(request, 'directoryservice/idmap_nss.html', {'form': form})
Exemplo n.º 2
0
def directoryservice_idmap_nss(request, id):
    idmap_nss = models.idmap_nss.objects.get(id=id)

    if request.method == "POST":
        form = forms.idmap_nss_Form(request.POST, instance=idmap_nss)
        if form.is_valid(): 
            form.save()
            return JsonResp(
                request,
                message="Idmap nss successfully edited."
            )
        else:
            return JsonResp(request, form=form)
    else:
        form = forms.idmap_nss_Form(instance=idmap_nss)

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