def updprofile(request): if request.method == "POST": t = UpdPfle(request.POST, instance=request.user) if t.is_valid(): t.save() return redirect('/pro') t = UpdPfle(instance=request.user) return render(request, 'html/updateprofile.html', {'z': t})
def orgupdate(request): z = User.objects.get(id=request.user.id) if request.method == "POST": p = UpdPfle1(request.POST, instance=z) q = UpdPfle2(request.POST, instance=z) r = UpdPfle(request.POST, instance=z) if p.is_valid() and q.is_valid() and r.is_valid(): p.save() q.save() r.save() return redirect('/profile') p = UpdPfle1(instance=z) q = UpdPfle2(instance=z) r = UpdPfle(instance=z) return render(request, 'html/updatedetails.html', {'u': p, 'p': q, 'k': r})