Hello i was writing a changePasswordForm manipulator when i realised
there were already one.
The problem is that the raise Validator error message are in english.

Is there a way to translate them ? apart of rewriting the class in my
view.

Now here is my mehod code in my application view.py
what do you think of the way i check if the user asking for changing
password, is the user he
said to be. (the url to edit pass is like this

(r'^cefinban/compte/(?P<username>[\w]+)/mot_de_passe',
'cefinban.recettes.views.edit_pass'),


#edit password
@user_passes_test(lambda u: not u.is_anonymous() ,
login_url='/cefinban/non_authorise')
def edit_pass(request, username):
        try:
                u = get_object_or_404(users, username__exact=username)
                if u.id != request.user.id:
                        return render_to_response('non_authorise',
                            context_instance=DjangoContext(request))
        except users.UserDoesNotExist:
                raise Http404
        manipulator = PasswordChangeForm(u)
        if request.POST:
                new_data = request.POST.copy()
                errors = manipulator.get_validation_errors(new_data)
                if not errors:
                        manipulator.do_html2python(new_data)
                        return render_to_response('message',
                            {'message':'Modification de votre password
reussit.', 'title':
                            'Modification du compte'},
                            context_instance=DjangoContext(request))
        else:
                errors = new_data = {}
        form = formfields.FormWrapper(manipulator, new_data, errors)
        return render_to_response('edit_pass', {'form': form},
context_instance=DjangoContext(request))


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to