Changeset 6758 for main/waeup.sirp/trunk
- Timestamp:
- 14 Sep 2011, 01:56:26 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6756 r6758 151 151 title = '' 152 152 label = 'Set password for first-time login' 153 ac prefix = 'PWD'153 ac_prefix = 'PWD' 154 154 pnav = 0 155 155 156 156 def update(self, SUBMIT=None): 157 self.reg_number = self.request.form.get('form.reg_number', None) 158 # We must not use form.ac_series and form.ac_number in forms since these 159 # are interpreted as applicant credentials in the applicants package 160 self.acseries = self.request.form.get('form.acseries', None) 161 self.acnumber = self.request.form.get('form.acnumber', None) 157 self.reg_number = self.request.form.get('reg_number', None) 158 self.ac_series = self.request.form.get('ac_series', None) 159 self.ac_number = self.request.form.get('ac_number', None) 162 160 163 161 if SUBMIT is None: … … 174 172 self.student_id = student.student_id 175 173 student_pw = student.password 176 pin = '%s-%s-%s' % (self.ac prefix,self.acseries,self.acnumber)174 pin = '%s-%s-%s' % (self.ac_prefix, self.ac_series, self.ac_number) 177 175 code = get_access_code(pin) 178 176 if not code: … … 197 195 #import pdb; pdb.set_trace() 198 196 invalidate_accesscode(pin,comment) 199 IUserAccount(student).setPassword(self.ac number)197 IUserAccount(student).setPassword(self.ac_number) 200 198 self.flash('Password has been set. Your Student Id is %s' 201 199 % self.student_id) … … 657 655 form_fields = grok.AutoFields( 658 656 IStudentClearanceEdit).omit('clearance_locked') 659 #grok.template('clearanceeditpage')660 657 label = 'Edit clearance data' 661 658 title = 'Clearance Data' -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/setpassword.pt
r6717 r6758 1 <h2 i18n:translate="" tal:condition="view/label" tal:content="view/label">Label</h2> 1 <h2 i18n:translate="" tal:condition="view/label" 2 tal:content="view/label">Label</h2> 2 3 <form method="POST"> 3 <input type="hidden" name="form.acprefix" value="" tal:attributes="value view/acprefix" />4 4 <table> 5 5 <tbody> 6 <tr> 7 <label for=" form.reg_number">Registration Number:6 <tr><td> 7 <label for="reg_number">Registration Number: 8 8 </label></td> <td> 9 <input name="form.reg_number" type="text" size="15" maxlength="15" value="" tal:attributes="value view/reg_number"/> </td> 9 <input name="reg_number" type="text" size="15" maxlength="15" 10 value="" tal:attributes="value view/reg_number"/> 11 </td></tr> 12 <tr> 13 <td> 14 <label for="ac_series">Access Code: 15 </label></td> <td> 16 <span tal:replace="view/ac_prefix">PIN Prefix 17 </span> - 18 <input name="ac_series" type="text" size="3" maxlength="3" 19 value="" tal:attributes="value view/ac_series"/> - 20 <input name="ac_number" type="text" size="10" maxlength="10" 21 value="" tal:attributes="value view/ac_number" /> </td> 10 22 </tr> 11 23 <tr> 12 <tr> <td> 13 <label for="form.acseries">Access Code: 14 </label></td> <td> 15 <span tal:replace="view/acprefix">PIN Prefix 16 </span> - 17 <input name="form.acseries" type="text" size="3" maxlength="3" value="" tal:attributes="value view/acseries"/> - 18 <input name="form.acnumber" type="text" size="10" maxlength="10" value="" tal:attributes="value view/acnumber" /> </td> 19 </tr> 20 <tr> 21 <td colspan="2"> 22 <input type="submit" name="SUBMIT" value="Show Student Id and set password" /> </td> 23 </tr> 24 <td colspan="2"> 25 <input type="submit" name="SUBMIT" 26 value="Show Student Id and set password" /> </td> 27 </tr> 24 28 </tbody> 25 29 </table> 26 30 </form> 27 <div> 31 <div><h3>Instructions:</h3> 28 32 <ul class="list"> 29 33 <li> Acquire a password access code (PWD). … … 31 35 <li> Enter your (JAMB) registration number and the access code. 32 36 </li> 33 <li> After pressing the button, your Student Id will be displayed and your password set. 34 The 10-digit part of the access code just used is your new password. 37 <li> After pressing the button, your Student Id will be displayed 38 and your password set. The 10-digit part of the access code just 39 used is your new password. 35 40 </li> 36 <li> Go to the <strong><a href="login">general login page</a></strong> and enter your new credentials. 41 <li> Go to the <strong><a href="login">general login 42 page</a></strong> and enter your new credentials. 37 43 </li> 38 44 </ul> -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r6756 r6758 311 311 student_path = 'http://localhost/app/students/%s' % test_student_id 312 312 self.browser.open(setpassword_path) 313 self.browser.getControl(name=" form.acseries").value = self.existing_series314 self.browser.getControl(name=" form.acnumber").value = self.existing_number315 self.browser.getControl(name=" form.reg_number").value = '123456'313 self.browser.getControl(name="ac_series").value = self.existing_series 314 self.browser.getControl(name="ac_number").value = self.existing_number 315 self.browser.getControl(name="reg_number").value = '123456' 316 316 self.browser.getControl("Show").click() 317 317 self.assertMatches('...Password has been set. Your Student Id is...', … … 320 320 self.browser.open(self.login_path) 321 321 self.browser.getControl(name="form.login").value = test_student_id 322 self.browser.getControl(name="form.password").value = self.existing_number 322 self.browser.getControl( 323 name="form.password").value = self.existing_number 323 324 self.browser.getControl("Login").click() 324 325 self.assertEqual(self.browser.url, student_path)
Note: See TracChangeset for help on using the changeset viewer.