Changeset 9123 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 30 Aug 2012, 06:08:34 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r9087 r9123 40 40 IPrincipalRoleManager, IPrincipalRoleMap) 41 41 from zope.session.interfaces import ISession 42 from zope.password.interfaces import IPasswordManager 42 43 from waeup.kofa.browser import ( 43 44 KofaPage, KofaForm, KofaEditFormPage, KofaAddFormPage, … … 206 207 self.redirect(self.camefrom) 207 208 return 209 # Display appropriate flash message if credentials are correct 210 # but student has been deactivated. 211 login = self.request.form['form.login'] 212 if len(login) == 8 and grok.getSite()['students'].has_key(login): 213 student = grok.getSite()['students'][ 214 self.request.form['form.login']] 215 password = self.request.form['form.password'] 216 passwordmanager = getUtility(IPasswordManager, 'SSHA') 217 if passwordmanager.checkPassword(student.password, password): 218 self.flash(_('Your account has been deactivated.')) 219 return 208 220 self.flash(_('You entered invalid credentials.')) 209 221 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9030 r9123 1163 1163 # and can perform actions 1164 1164 IWorkflowInfo(self.student).fireTransition('admit') 1165 # Students can't login if their account is suspended 1165 # Students can't login if their account is suspended/deactivated 1166 1166 self.student.suspended = True 1167 1167 self.browser.open(self.login_path) … … 1170 1170 self.browser.getControl("Login").click() 1171 1171 self.assertTrue( 1172 'You entered invalid credentials.' in self.browser.contents)1172 'Your account has been deactivated.' in self.browser.contents) 1173 1173 self.student.suspended = False 1174 1174 self.browser.getControl("Login").click()
Note: See TracChangeset for help on using the changeset viewer.