Changeset 8983 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 12 Jul 2012, 11:43:12 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/authentication.py
r8757 r8983 102 102 def checkPassword(self, password): 103 103 """Check whether the given `password` matches the one stored. 104 105 We additionally check if student account has been suspended. 104 106 """ 105 107 if not isinstance(password, basestring): … … 107 109 if not getattr(self.context, 'password', None): 108 110 # unset/empty passwords do never match 111 return False 112 if self.context.suspended == True: 109 113 return False 110 114 passwordmanager = getUtility(IPasswordManager, 'SSHA') -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8977 r8983 292 292 grok.require('waeup.viewStudent') 293 293 grok.template('basepage') 294 form_fields = grok.AutoFields(IStudentBase).omit('password' )294 form_fields = grok.AutoFields(IStudentBase).omit('password', 'suspended') 295 295 pnav = 4 296 296 297 297 @property 298 298 def label(self): 299 return _('${a}: Base Data', 299 if self.context.suspended: 300 return _('${a}: Base Data (account suspended)', 301 mapping = {'a':self.context.display_fullname}) 302 return _('${a}: Base Data', 300 303 mapping = {'a':self.context.display_fullname}) 301 304 -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r8977 r8983 157 157 is_postgrad = Attribute('True if postgraduate student') 158 158 159 suspended = schema.Bool( 160 title = _(u'Account suspended'), 161 default = False, 162 ) 163 159 164 student_id = schema.TextLine( 160 165 title = _(u'Student Id'), -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_authentication.py
r8351 r8983 65 65 email = None 66 66 phone = None 67 suspended = False 67 68 68 69 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r8947 r8983 44 44 'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,' 45 45 'firstname,lastname,matric_number,middlename,nationality,' 46 'perm_address,phone,reg_number,sex,student_id, password,'46 'perm_address,phone,reg_number,sex,student_id,suspended,password,' 47 47 'state,history,certcode\r\n' 48 48 49 49 'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,' 50 50 'Anna,Tester,M123456,M.,NG,"Studentroad 21\nLagos 123456\n",' 51 '+234-123-12345#,123456,f,A111111, ,created'51 '+234-123-12345#,123456,f,A111111,0,,created' 52 52 in result 53 53 ) … … 64 64 'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,' 65 65 'firstname,lastname,matric_number,middlename,nationality,' 66 'perm_address,phone,reg_number,sex,student_id, password,'66 'perm_address,phone,reg_number,sex,student_id,suspended,password,' 67 67 'state,history,certcode\r\n' 68 68 69 69 'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,' 70 70 'Anna,Tester,M123456,M.,NG,"Studentroad 21\nLagos 123456\n",' 71 '+234-123-12345#,123456,f,A111111, ,created'71 '+234-123-12345#,123456,f,A111111,0,,created' 72 72 in result 73 73 ) … … 83 83 'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,' 84 84 'firstname,lastname,matric_number,middlename,nationality,' 85 'perm_address,phone,reg_number,sex,student_id, password,'85 'perm_address,phone,reg_number,sex,student_id,suspended,password,' 86 86 'state,history,certcode\r\n' 87 87 88 88 'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,' 89 89 'Anna,Tester,M123456,M.,NG,"Studentroad 21\nLagos 123456\n",' 90 '+234-123-12345#,123456,f,A111111, ,created'90 '+234-123-12345#,123456,f,A111111,0,,created' 91 91 in result 92 92 )
Note: See TracChangeset for help on using the changeset viewer.