diff options
author | Marcin Kuzminski <marcin@python-works.com> | 2010-11-20 15:30:48 +0100 |
---|---|---|
committer | Marcin Kuzminski <marcin@python-works.com> | 2010-11-20 15:30:48 +0100 |
commit | 0de780386426cc0359d72dc08ae444462497df36 (patch) | |
tree | 5971ab5d90533ccba2c1520527c1d76ce40a605c /rhodecode/model/forms.py | |
parent | f4efc97ba6bd94adc27d50c7fde0fd1bb0992818 (diff) |
fixed bug in forms found due to testing,
fixed tests
--HG--
branch : beta
Diffstat (limited to 'rhodecode/model/forms.py')
-rw-r--r-- | rhodecode/model/forms.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rhodecode/model/forms.py b/rhodecode/model/forms.py index d2b49d75..2b4488a3 100644 --- a/rhodecode/model/forms.py +++ b/rhodecode/model/forms.py @@ -94,6 +94,14 @@ class ValidPassword(formencode.validators.FancyValidator): e_dict = {'password_confirmation':_('Invalid characters in password')} raise formencode.Invalid('', value, state, error_dict=e_dict) + if value.get('new_password'): + try: + value['new_password'] = \ + get_crypt_password(value['new_password']) + except UnicodeEncodeError: + e_dict = {'new_password':_('Invalid characters in password')} + raise formencode.Invalid('', value, state, error_dict=e_dict) + return value class ValidPasswordsMatch(formencode.validators.FancyValidator): |