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

    if request.method == "POST":
        form = forms.idmap_hash_Form(request.POST, instance=idmap_hash)
        if form.is_valid():
            form.save()
            return JsonResp(request, message="Idmap hash successfully edited.")
        else:
            return JsonResp(request, form=form)
    else:
        form = forms.idmap_hash_Form(instance=idmap_hash)

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

    if request.method == "POST":
        form = forms.idmap_hash_Form(request.POST, instance=idmap_hash)
        if form.is_valid(): 
            form.save()
            return JsonResp(
                request,
                message="Idmap hash successfully edited."
            )
        else:
            return JsonResp(request, form=form)
    else:
        form = forms.idmap_hash_Form(instance=idmap_hash)

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