Exemple #1
0
def requestform(rq):
    e2 = User.objects.get(id=rq.user.id)
    if rq.method == 'POST':
        print(e2)
        e2.age = rq.POST['age']
        e2.impf = rq.POST['fil']
        e2.address = rq.POST['ad']
        e2.save()
        return redirect('/lg')
    k2 = Usperm(instance=e2)
    return render(rq, 'html/requestp.html', {'y': k2})
Exemple #2
0
def updatepermissions(request, k):
    r = User.objects.get(id=k)
    if request.method == "POST":
        k = Usperm(request.POST, instance=r)
        if k.is_valid():
            k.save()
            return redirect('/gper')
    k2 = Usperm(instance=r)
    return render(request, 'html/updatepermissions.html', {'y': k2})