Exemple #1
0
def ik_chpasswd(request):
    errl = []
    if request.method == "POST":
        form = ChangePasswordForm(request.POST)
        if form.is_valid():
            try:
                return _ik_chpasswd_handle_valid_form(request, form)
            except giedo.ChangePasswordError as e:
                errl.extend(e.args)
    else:
        form = ChangePasswordForm()
    errl.extend(form.non_field_errors())
    errstr = humanized_enum(errl)
    return render_to_response(
        "leden/ik_chpasswd.html", {"form": form, "errors": errstr}, context_instance=RequestContext(request)
    )
Exemple #2
0
def ik_chpasswd(request):
    errl = []
    if request.method == 'POST':
        form = ChangePasswordForm(request.POST)
        if form.is_valid():
            try:
                return _ik_chpasswd_handle_valid_form(request,
                                                      form)
            except giedo.ChangePasswordError as e:
                errl.extend(e.args)
    else:
        form = ChangePasswordForm()
    errl.extend(form.non_field_errors())
    errstr = humanized_enum(errl)
    return render(request, 'leden/ik_chpasswd.html',
                  {'form': form, 'errors': errstr})
Exemple #3
0
def ik_chpasswd_villanet(request):
    errl = []
    if request.method == "POST":
        form = ChangePasswordForm(request.POST)
        if form.is_valid():
            try:
                oldpw = form.cleaned_data["old_password"]
                newpw = form.cleaned_data["new_password"]
                giedo.change_villanet_password(str(request.user.name), oldpw, newpw)
                t = _("Lieve %s, maar natuurlijk, jouw wachtwoord voor het " + "villa-netwerk is veranderd.")
                messages.info(request, t % request.user.first_name)
                return HttpResponseRedirect(reverse("smoelen-home"))
            except giedo.ChangePasswordError as e:
                errl.extend(e.args)
    else:
        form = ChangePasswordForm()
    errl.extend(form.non_field_errors())
    errstr = humanized_enum(errl)
    return render_to_response(
        "leden/ik_chpasswd_villanet.html", {"form": form, "errors": errstr}, context_instance=RequestContext(request)
    )
Exemple #4
0
def ik_chpasswd(request):
    errl = []
    if request.method == 'POST':
        form = ChangePasswordForm(request.POST)
        if form.is_valid():
            try:
                return _ik_chpasswd_handle_valid_form(request, form)
            except giedo.ChangePasswordError as e:
                errl.extend(e.args)
    else:
        form = ChangePasswordForm()
    errl.extend(form.non_field_errors())
    errstr = humanized_enum(errl)
    return render(request, 'leden/ik_chpasswd.html', {
        'form': form,
        'errors': errstr
    })
Exemple #5
0
def ik_chpasswd_villanet(request):
    errl = []
    if request.method == 'POST':
        form = ChangePasswordForm(request.POST)
        if form.is_valid():
            try:
                oldpw = form.cleaned_data['old_password']
                newpw = form.cleaned_data['new_password']
                giedo.change_villanet_password(str(request.user.name), oldpw,
                        newpw)
                t = ("Lieve %s, maar natuurlijk, jouw wachtwoord voor het "+
                        "villa-netwerk is veranderd.")
                request.user.push_message(t % request.user.first_name)
                return HttpResponseRedirect(reverse('smoelen-home'))
            except giedo.ChangePasswordError as e:
                errl.extend(e.args)
    else:
        form = ChangePasswordForm()
    errl.extend(form.non_field_errors())
    errstr = humanized_enum(errl)
    return render_to_response('leden/ik_chpasswd_villanet.html',
            { 'form':form, 'errors':errstr},
            context_instance=RequestContext(request))