Changeset 13344 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 23 Oct 2015, 06:41:21 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r13247 r13344 2776 2776 grok.template('requestpw') 2777 2777 form_fields = grok.AutoFields(IStudentRequestPW).select( 2778 ' firstname','number','email')2778 'lastname','number','email') 2779 2779 label = _('Request password for first-time login') 2780 2780 … … 2804 2804 return 2805 2805 number = data.get('number','') 2806 firstname = data.get('firstname','')2806 lastname = data.get('lastname','') 2807 2807 cat = getUtility(ICatalog, name='students_catalog') 2808 2808 results = list( … … 2813 2813 if results: 2814 2814 student = results[0] 2815 if getattr(student,' firstname',None) is None:2815 if getattr(student,'lastname',None) is None: 2816 2816 self.flash(_('An error occurred.'), type="danger") 2817 2817 return 2818 elif student. firstname.lower() != firstname.lower():2818 elif student.lastname.lower() != lastname.lower(): 2819 2819 # Don't tell the truth here. Anonymous must not 2820 # know that a record was found and only the firstname2820 # know that a record was found and only the lastname 2821 2821 # verification failed. 2822 2822 self.flash(_('No student record found.'), type="warning") -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r13314 r13344 3231 3231 # Student with wrong number can't be found. 3232 3232 self.browser.open('http://localhost/app/requestpw') 3233 self.browser.getControl(name="form. firstname").value = 'Anna'3233 self.browser.getControl(name="form.lastname").value = 'Tester' 3234 3234 self.browser.getControl(name="form.number").value = 'anynumber' 3235 3235 self.browser.getControl(name="form.email").value = 'xx@yy.zz' … … 3237 3237 self.assertTrue('No student record found.' 3238 3238 in self.browser.contents) 3239 # Anonymous is not informed that firstname verification failed.3239 # Anonymous is not informed that lastname verification failed. 3240 3240 # It seems that the record doesn't exist. 3241 3241 self.browser.open('http://localhost/app/requestpw') 3242 self.browser.getControl(name="form. firstname").value = 'Johnny'3242 self.browser.getControl(name="form.lastname").value = 'Johnny' 3243 3243 self.browser.getControl(name="form.number").value = '123' 3244 3244 self.browser.getControl(name="form.email").value = 'xx@yy.zz' … … 3246 3246 self.assertTrue('No student record found.' 3247 3247 in self.browser.contents) 3248 # Even with the correct firstname we can't register if a3248 # Even with the correct lastname we can't register if a 3249 3249 # password has been set and used. 3250 self.browser.getControl(name="form. firstname").value = 'Anna'3250 self.browser.getControl(name="form.lastname").value = 'Tester' 3251 3251 self.browser.getControl(name="form.number").value = '123' 3252 3252 self.browser.getControl("Send login credentials").click() … … 3255 3255 self.browser.open('http://localhost/app/requestpw') 3256 3256 self.app['students'][self.student_id].password = None 3257 # The firstname field, used for verification, is not case-sensitive.3258 self.browser.getControl(name="form. firstname").value = 'aNNa'3257 # The lastname field, used for verification, is not case-sensitive. 3258 self.browser.getControl(name="form.lastname").value = 'tESTer' 3259 3259 self.browser.getControl(name="form.number").value = '123' 3260 3260 self.browser.getControl(name="form.email").value = 'new@yy.zz' … … 3265 3265 # We can also use the matric_number instead. 3266 3266 self.browser.open('http://localhost/app/requestpw') 3267 self.browser.getControl(name="form. firstname").value = 'aNNa'3267 self.browser.getControl(name="form.lastname").value = 'tESTer' 3268 3268 self.browser.getControl(name="form.number").value = '234' 3269 3269 self.browser.getControl(name="form.email").value = 'new@yy.zz'
Note: See TracChangeset for help on using the changeset viewer.