[Answered ]-Django model form save, 'int' object has no attribute 'save'

2👍

def add_profile(request):
    save_user = Profile(user=request.user)
    form = ProfileForm()
    if request.method == "POST":
        form = ProfileForm(request.POST, instance=save_user)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect('/profile/')
    return render_to_response('profile.html',{'form':form},context_instance=RequestContext(request))

Leave a comment