Changeset 15368 for main/waeup.aaue/trunk/src
- Timestamp:
- 25 Mar 2019, 06:30:13 (6 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py
r15194 r15368 213 213 self.assertEqual(self.student.matric_number, 'PTP/fac1/dep1/04/00001') 214 214 self.assertEqual(site['configuration'].next_matric_integer, 2) 215 # SHS have an extended matric number with leading 'SHS' 216 # and same counter as PTP. 217 self.student.matric_number = None 218 self.student['studycourse'].certificate.study_mode = 'shs' 219 msg, mnumber = utils.setMatricNumber(self.student) 220 self.assertEqual(self.student.matric_number, 'SHS/fac1/dep1/04/00002') 221 self.assertEqual(site['configuration'].next_matric_integer, 3) 215 222 # Students in faculty FBM get an extended matric number with leading 'CMS' 216 223 # and the regular counter which is next_matric_integer_2. -
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r15194 r15368 154 154 is as an attribute of the site configuration container. 155 155 """ 156 if student.current_mode in ('ug_pt', 'de_pt' ):156 if student.current_mode in ('ug_pt', 'de_pt', 'shs'): 157 157 grok.getSite()['configuration'].next_matric_integer += 1 158 158 return … … 197 197 return None, "AAU/SPS/%s/%s/%s/%s/%05d" % ( 198 198 faccode, depcode, year, degree, next_integer) 199 if student.current_mode in ('shs',): 200 next_integer = grok.getSite()['configuration'].next_matric_integer 201 if next_integer == 0: 202 return _('Matriculation number cannot be set.'), None 203 return None, "SHS/%s/%s/%s/%05d" % ( 204 faccode, depcode, year, next_integer) 199 205 if student.current_mode in ('ug_pt', 'de_pt'): 200 206 next_integer = grok.getSite()['configuration'].next_matric_integer
Note: See TracChangeset for help on using the changeset viewer.