Changeset 13664 for main/waeup.aaue/trunk/src/waeup/aaue
- Timestamp:
- 8 Feb 2016, 16:03:04 (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
r13609 r13664 154 154 self.student['studycourse'].certificate.study_mode = 'special_pg_ft' 155 155 self.student.matric_number = None 156 self.certificate.degree = 'AGRB' 156 157 msg, mnumber = utils.setMatricNumber(self.student) 157 self.assertEqual(self.student.matric_number, 'AAU/SPS/ABC/dep1/04/ CERT1/00001')158 self.assertEqual(self.student.matric_number, 'AAU/SPS/ABC/dep1/04/AGRB/00001') 158 159 self.assertEqual(site['configuration'].next_matric_integer_3, 2) 159 160 # Foundation programme students don't get matric number. -
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r13636 r13664 61 61 depcode = student.depcode 62 62 certcode = student.certcode 63 degree = getattr( 64 getattr(student.get('studycourse', None), 'certificate', None), 65 'degree', None) 63 66 year = unicode(student.entry_session)[2:] 64 67 if not student.state in (PAID, ) or not student.is_fresh or \ … … 67 70 if student.is_postgrad: 68 71 next_integer = grok.getSite()['configuration'].next_matric_integer_3 69 if n ext_integer == 0:72 if not degree or next_integer == 0: 70 73 return _('Matriculation number cannot be set.'), None 71 74 return None, "AAU/SPS/%s/%s/%s/%s/%05d" % ( 72 faccode, depcode, year, certcode, next_integer)75 faccode, depcode, year, degree, next_integer) 73 76 if student.current_mode in ('ug_pt', 'de_pt'): 74 77 next_integer = grok.getSite()['configuration'].next_matric_integer
Note: See TracChangeset for help on using the changeset viewer.