Mercurial > public > src > rhodecode
comparison pylons_app/model/forms.py @ 370:40bccabf4574
fixed bug for user update, when password was always set.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 14 Jul 2010 15:42:39 +0200 |
parents | aafd9a98ea58 |
children | 664a5b8c551a |
comparison
equal
deleted
inserted
replaced
369:51362853ac3b | 370:40bccabf4574 |
---|---|
59 raise formencode.Invalid(_('Invalid username'), value, state) | 59 raise formencode.Invalid(_('Invalid username'), value, state) |
60 | 60 |
61 class ValidPassword(formencode.validators.FancyValidator): | 61 class ValidPassword(formencode.validators.FancyValidator): |
62 | 62 |
63 def to_python(self, value, state): | 63 def to_python(self, value, state): |
64 return get_crypt_password(value) | 64 if value: |
65 return get_crypt_password(value) | |
65 | 66 |
66 class ValidAuth(formencode.validators.FancyValidator): | 67 class ValidAuth(formencode.validators.FancyValidator): |
67 messages = { | 68 messages = { |
68 'invalid_password':_('invalid password'), | 69 'invalid_password':_('invalid password'), |
69 'invalid_login':_('invalid user name'), | 70 'invalid_login':_('invalid user name'), |