Exemplo n.º 1
0
def adduser(request):
    if request.method == 'POST':
        form = AddUserForm(request.POST)
        if form.is_valid():
            user = form.save(commit=False)
            user.set_password(form.cleaned_data['password'])
            form.save()
            return HttpResponseRedirect(reverse('listuserurl'))
    else:
        form = AddUserForm()
    kwvars = {
        'form': form,
        'request': request,
    }
    return render_to_response('UserManage/user.add.html', kwvars, RequestContext(request))
Exemplo n.º 2
0
def AddUser(request):
    if request.method=='POST':
        form = AddUserForm(request.POST)
        if form.is_valid():
            user = form.save(commit=False)
            user.set_password(form.cleaned_data['password'])
            form.save()
            return HttpResponseRedirect(reverse('listuserurl'))
    else:
        form = AddUserForm()
    kwvars = {
        'form':form,
        'request':request,
    }
    return render_to_response('UserManage/user.add.html',kwvars,RequestContext(request))
Exemplo n.º 3
0
def AddUser(request):

    if request.method == "POST":
        form = AddUserForm(request.POST)
        if form.is_valid():
            user = form.save(commit=False)
            user.set_password(form.cleaned_data["password"])
            form.save()
            return HttpResponseRedirect(reverse("listuserurl"))
    else:
        form = AddUserForm()

    kwvars = {"form": form, "request": request}

    return render_to_response("UserManage/user.add.html", kwvars, RequestContext(request))