Changeset 6704 for main/waeup.sirp/trunk
- Timestamp:
- 9 Sep 2011, 22:27:18 (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
r6701 r6704 156 156 self.reg_number = self.request.form.get('form.reg_number', None) 157 157 # We must not use form.ac_series and form.ac_number in forms since these 158 # are interpreted by applicant credentials158 # are interpreted as applicant credentials in the applicants package 159 159 self.acseries = self.request.form.get('form.acseries', None) 160 160 self.acnumber = self.request.form.get('form.acnumber', None) … … 170 170 self.flash('More than one student found.') 171 171 return 172 self.student_id = hitlist[0].student_id 173 student_pw = hitlist[0].context.password 174 if student_pw: 175 self.flash('Password has already been set. Please request a password reset.') 176 return 172 student = hitlist[0].context 173 self.student_id = student.student_id 174 student_pw = student.password 177 175 pin = '%s-%s-%s' % (self.acprefix,self.acseries,self.acnumber) 178 176 code = get_access_code(pin) … … 180 178 self.flash('Access code is invalid.') 181 179 return 180 if student_pw and pin == student.adm_code: 181 self.flash('Password has already been set. Your Student Id is %s' 182 % self.student_id) 183 return 184 elif student_pw: 185 self.flash('Password has already been set.') 186 return 182 187 # Mark pin as used (this also fires a pin related transition) 183 188 # and set student password … … 186 191 return 187 192 else: 188 comment = u"AC invalidated "193 comment = u"AC invalidated for %s" % self.student_id 189 194 # Here we know that the ac is in state initialized so we do not 190 195 # expect an exception 191 196 #import pdb; pdb.set_trace() 192 197 invalidate_accesscode(pin,comment) 193 IUserAccount(hitlist[0].context).setPassword(self.acnumber) 198 IUserAccount(student).setPassword(self.acnumber) 199 self.flash('Password has been set. Your Student Id is %s' 200 % self.student_id) 194 201 return 195 202 -
main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
r6699 r6704 63 63 #student_id = Attribute('Randomly generated id') 64 64 password = Attribute('Encrypted password of a student') 65 adm_code = Attribute('Admission checking access code') 65 66 66 67 def loggerInfo(ob_class, comment): -
main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
r6699 r6704 46 46 self.student_id = u'Z654321' 47 47 self.password = None 48 self.adm_code = None 48 49 return 49 50
Note: See TracChangeset for help on using the changeset viewer.