Changeset 11738
- Timestamp:
- 7 Jul 2014, 06:35:58 (10 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r11737 r11738 4 4 1.3dev (unreleased) 5 5 =================== 6 7 * Use lastname (surname) instead of firstname to verify found application record 8 on ApplicantRegistrationPage. 6 9 7 10 * Append hash '#' also to datetimes to circumvent unwanted excel automatic. -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r11733 r11738 1105 1105 if self.context.mode == 'update': 1106 1106 form_fields = grok.AutoFields(IApplicantRegisterUpdate).select( 1107 ' firstname','reg_number','email')1107 'lastname','reg_number','email') 1108 1108 else: #if self.context.mode == 'create': 1109 1109 form_fields = grok.AutoFields(IApplicantEdit).select( … … 1149 1149 # Update applicant 1150 1150 reg_number = data.get('reg_number','') 1151 firstname = data.get('firstname','')1151 lastname = data.get('lastname','') 1152 1152 cat = getUtility(ICatalog, name='applicants_catalog') 1153 1153 results = list( … … 1155 1155 if results: 1156 1156 applicant = results[0] 1157 if getattr(applicant,' firstname',None) is None:1157 if getattr(applicant,'lastname',None) is None: 1158 1158 self.flash(_('An error occurred.'), type='danger') 1159 1159 return 1160 elif applicant. firstname.lower() != firstname.lower():1160 elif applicant.lastname.lower() != lastname.lower(): 1161 1161 # Don't tell the truth here. Anonymous must not 1162 # know that a record was found and only the firstname1162 # know that a record was found and only the lastname 1163 1163 # verification failed. 1164 1164 self.flash(_('No application record found.'), type='warning') -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r11599 r11738 614 614 ) 615 615 616 firstname = schema.TextLine( 617 title = _(u'First Name'), 616 #firstname = schema.TextLine( 617 # title = _(u'First Name'), 618 # required = True, 619 # ) 620 621 lastname = schema.TextLine( 622 title = _(u'Last Name (Surname)'), 618 623 required = True, 619 624 ) -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r11729 r11738 1210 1210 self.applicantscontainer.mode = 'update' 1211 1211 self.browser.open(self.container_path + '/register') 1212 self.browser.getControl(name="form. firstname").value = 'John'1212 self.browser.getControl(name="form.lastname").value = 'Better' 1213 1213 self.browser.getControl(name="form.reg_number").value = 'anynumber' 1214 1214 self.browser.getControl(name="form.email").value = 'xx@yy.zz' … … 1217 1217 in self.browser.contents) 1218 1218 # Even with the correct reg_number we can't register 1219 # because firstname attribute is not set.1219 # because lastname attribute is not set. 1220 1220 self.applicantscontainer.mode = 'update' 1221 1221 self.browser.open(self.container_path + '/register') 1222 self.browser.getControl(name="form. firstname").value = 'John'1222 self.browser.getControl(name="form.lastname").value = 'Better' 1223 1223 self.browser.getControl(name="form.reg_number").value = '1234' 1224 1224 self.browser.getControl(name="form.email").value = 'xx@yy.zz' … … 1227 1227 # Let's set this attribute manually 1228 1228 # and try to register with a wrong name. 1229 self.applicant. firstname = u'John'1229 self.applicant.lastname = u'Better' 1230 1230 self.browser.open(self.container_path + '/register') 1231 self.browser.getControl(name="form. firstname").value = 'Johnny'1231 self.browser.getControl(name="form.lastname").value = 'Worse' 1232 1232 self.browser.getControl(name="form.reg_number").value = '1234' 1233 1233 self.browser.getControl(name="form.email").value = 'xx@yy.zz' 1234 1234 self.browser.getControl("Send login credentials").click() 1235 # Anonymous is not informed that firstname verification failed.1235 # Anonymous is not informed that lastname verification failed. 1236 1236 # It seems that the record doesn't exist. 1237 1237 self.assertTrue('No application record found.' 1238 1238 in self.browser.contents) 1239 # Even with the correct firstname we can't register if a1239 # Even with the correct lastname we can't register if a 1240 1240 # password has been set and used. 1241 1241 IWorkflowState(self.applicant).setState('started') 1242 self.browser.getControl(name="form. firstname").value = 'John'1242 self.browser.getControl(name="form.lastname").value = 'Better' 1243 1243 self.browser.getControl(name="form.reg_number").value = '1234' 1244 1244 self.browser.getControl("Send login credentials").click() … … 1252 1252 IWorkflowState(self.applicant).setState('initialized') 1253 1253 self.browser.open(self.container_path + '/register') 1254 # The firstname field, used for verification, is not case-sensitive.1255 self.browser.getControl(name="form. firstname").value = 'jOhn'1254 # The lastname field, used for verification, is not case-sensitive. 1255 self.browser.getControl(name="form.lastname").value = 'bEtter' 1256 1256 self.browser.getControl(name="form.reg_number").value = '1234' 1257 1257 self.browser.getControl(name="form.email").value = 'new@yy.zz'
Note: See TracChangeset for help on using the changeset viewer.