Changeset - 351013049742
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 15 years ago 2010-05-26 23:55:48
marcin@python-works.com
CHanged form error when user account is disabled.
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
pylons_app/model/forms.py
Show inline comments
 
@@ -56,12 +56,13 @@ class ValidAuth(formencode.validators.Fa
 
            'disabled_account':_('Your acccount is disabled')
 
            
 
            }
 
    #error mapping
 
    e_dict = {'username':messages['invalid_login'],
 
              'password':messages['invalid_password']}
 
    e_dict_disable = {'username':messages['disabled_account']}
 
    
 
    def validate_python(self, value, state):
 
        sa = meta.Session
 
        crypted_passwd = get_crypt_password(value['password'])
 
        username = value['username']
 
        try:
 
@@ -87,13 +88,14 @@ class ValidAuth(formencode.validators.Fa
 
                                             state=State_obj), value, state,
 
                                             error_dict=self.e_dict)
 
            else:
 
                log.warning('user %s is disabled', username)
 
                raise formencode.Invalid(self.message('disabled_account',
 
                                         state=State_obj),
 
                                         value, state, error_dict=self.e_dict)
 
                                         value, state,
 
                                         error_dict=self.e_dict_disable)
 
            
 
            
 
        
 
#===============================================================================
 
# FORMS        
 
#===============================================================================
0 comments (0 inline, 0 general)