Why do you want to validate the old password? The only requirement should 
be that it actually matches the old password, and therefore the only error 
message you would want to report is that the password doesn't match (which 
can be customized via auth.messages.invalid_password).

Anthony

On Wednesday, September 6, 2017 at 6:08:00 AM UTC-4, Simona Chovancová 
wrote:
>
> I have a table defined like this:
>
> form_change_password = auth.change_password()
> form_change_password.element(
>         'input', _name='old_password')['_id'] = 'form-4'
> form_change_password.element(
>         'input', _name='new_password')['_id'] = 'form-5'
> form_change_password.element(
>         'input', _name='new_password2')['_id'] = 'form-6'
>
> When I leave all fields empty, the new_password has same error_message as 
> any other password, edited using db.auth_user.password.requires = ..., but 
> the old_password has just 'Too short' as error_message, how do I change 
> old_password's error_message?
> Thank you.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to