Changeset 13609 for main/waeup.aaue/trunk/src/waeup/aaue
- Timestamp:
- 13 Jan 2016, 09:16:36 (9 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
r13594 r13609 128 128 site['configuration'].next_matric_integer = 1 129 129 site['configuration'].next_matric_integer_2 = 1 130 site['configuration'].next_matric_integer_3 = 1 130 131 self.student.matric_number = None 131 132 # Regular ft students have a matric number without leading constant. … … 140 141 self.assertEqual(self.student.matric_number, 'PTP/fac1/dep1/04/00001') 141 142 self.assertEqual(site['configuration'].next_matric_integer, 2) 142 # Students in faculty FBM an extended matric number with leading 'CMS'143 # Students in faculty FBM get an extended matric number with leading 'CMS' 143 144 # and the regular counter which is next_matric_integer_2. 144 145 self.app['faculties']['fac1'].code = 'FBM' … … 148 149 self.assertEqual(self.student.matric_number, 'CMS/FBM/dep1/04/00002') 149 150 self.assertEqual(site['configuration'].next_matric_integer_2, 3) 151 # PG Students get an extended matric number with leading 'AAU/SPS' 152 # and the pg counter which is next_matric_integer_3. 153 self.app['faculties']['fac1'].code = 'ABC' 154 self.student['studycourse'].certificate.study_mode = 'special_pg_ft' 155 self.student.matric_number = None 156 msg, mnumber = utils.setMatricNumber(self.student) 157 self.assertEqual(self.student.matric_number, 'AAU/SPS/ABC/dep1/04/CERT1/00001') 158 self.assertEqual(site['configuration'].next_matric_integer_3, 2) 150 159 # Foundation programme students don't get matric number. 151 160 self.student.matric_number = None -
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r13594 r13609 51 51 grok.getSite()['configuration'].next_matric_integer += 1 52 52 return 53 elif student.is_postgrad: 54 grok.getSite()['configuration'].next_matric_integer_3 += 1 55 return 53 56 grok.getSite()['configuration'].next_matric_integer_2 += 1 54 57 return … … 57 60 faccode = student.faccode 58 61 depcode = student.depcode 62 certcode = student.certcode 59 63 year = unicode(student.entry_session)[2:] 60 64 if not student.state in (PAID, ) or not student.is_fresh or \ … … 62 66 return _('Matriculation number cannot be set.'), None 63 67 if student.is_postgrad: 64 return _('Matriculation number cannot be set.'), None 68 next_integer = grok.getSite()['configuration'].next_matric_integer_3 69 if next_integer == 0: 70 return _('Matriculation number cannot be set.'), None 71 return None, "AAU/SPS/%s/%s/%s/%s/%05d" % ( 72 faccode, depcode, year, certcode, next_integer) 65 73 if student.current_mode in ('ug_pt', 'de_pt'): 66 74 next_integer = grok.getSite()['configuration'].next_matric_integer
Note: See TracChangeset for help on using the changeset viewer.