changeset 227:351013049742

CHanged form error when user account is disabled.
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 26 May 2010 23:55:48 +0200
parents c6526b7531e9
children c49ebe560af2
files pylons_app/model/forms.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pylons_app/model/forms.py	Wed May 26 23:55:20 2010 +0200
+++ b/pylons_app/model/forms.py	Wed May 26 23:55:48 2010 +0200
@@ -59,6 +59,7 @@
     #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
@@ -90,7 +91,8 @@
                 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)