Changeset 13359 for main/waeup.aaue/trunk/src/waeup/aaue
- Timestamp:
- 28 Oct 2015, 20:54:47 (9 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/locales/en/LC_MESSAGES/waeup.kofa.po
r13357 r13359 76 76 "Your application process in not complete, please login to complete and " 77 77 "submit your application." 78 79 #: waeup/kofa/interfaces.py:718 80 msgid "Next Matriculation Number Integer" 81 msgstr "Next PTP Matriculation Number Integer" 82 83 #: waeup/kofa/interfaces.py:719 84 msgid "Integer used for constructing the next matriculation number" 85 msgstr "" 86 "Integer used for constructing the next matriculation number of part-time " 87 "students" 88 89 #: waeup/kofa/interfaces.py:727 90 msgid "Next Matriculation Number Integer 2" 91 msgstr "Next Regular Matriculation Number Integer" 92 93 #: waeup/kofa/interfaces.py:728 94 msgid "2nd integer used for constructing the next matriculation number" 95 msgstr "" 96 "Integer used for constructing the next matriculation number of regular " 97 "students" -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r13353 r13359 462 462 self.assertEqual(self.browser.headers['Status'], '200 Ok') 463 463 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 464 path = os.path.join(samples_dir(), ' transcript.pdf')464 path = os.path.join(samples_dir(), 'matric_number_slip.pdf') 465 465 open(path, 'wb').write(self.browser.contents) 466 466 print "Sample PDF matric_number_slip.pdf written to %s" % path -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py
r11653 r13359 116 116 utils = getUtility(IStudentsUtils) 117 117 site['configuration'].next_matric_integer = 1 118 site['configuration'].next_matric_integer_2 = 1 118 119 self.student.matric_number = None 119 # So far we don't set matric numbers of ft students.120 # Regular ft students have a matric number without leading constant. 120 121 msg, mnumber = utils.setMatricNumber(self.student) 121 self.assertEqual(msg, 'Matriculation number cannot be set.') 122 self.assertEqual(mnumber, None) 123 #self.assertEqual(msg, None) 124 #self.assertEqual(mnumber, 1) 125 #self.assertEqual(self.student.matric_number, 'fac1/dep1/04/00001') 126 #self.assertEqual(site['configuration'].next_matric_integer, 2) 127 # Part time have an extended matric number 122 self.assertEqual(self.student.matric_number, 'fac1/dep1/04/00001') 123 self.assertEqual(msg, None) 124 # Part time have an extended matric number with leading 'PTP' 125 # and a different counter which is next_matric_integer. 128 126 self.student.matric_number = None 129 127 self.student['studycourse'].certificate.study_mode = 'ug_pt' 130 128 msg, mnumber = utils.setMatricNumber(self.student) 131 129 self.assertEqual(self.student.matric_number, 'PTP/fac1/dep1/04/00001') 130 self.assertEqual(site['configuration'].next_matric_integer, 2) 131 # Students in faculty FBM an extended matric number with leading 'CMS' 132 # and the regular counter which is next_matric_integer_2. 133 self.app['faculties']['fac1'].code = 'FBM' 134 self.student['studycourse'].certificate.study_mode = 'ug_ft' 135 self.student.matric_number = None 136 msg, mnumber = utils.setMatricNumber(self.student) 137 self.assertEqual(self.student.matric_number, 'CMS/FBM/dep1/04/00002') 138 self.assertEqual(site['configuration'].next_matric_integer_2, 3) 132 139 # Foundation programme students don't get matric number. 133 140 self.student.matric_number = None -
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r13353 r13359 40 40 (5, '1st Class Honours')) 41 41 42 def increaseMatricInteger(self, student): 43 """Increase counter for matric numbers. 44 This counter can be a centrally stored attribute or an attribute of 45 faculties, departments or certificates. In the base package the counter 46 is as an attribute of the site configuration container. 47 """ 48 if student.current_mode in ('ug_pt', 'de_pt'): 49 grok.getSite()['configuration'].next_matric_integer += 1 50 return 51 grok.getSite()['configuration'].next_matric_integer_2 += 1 52 return 53 42 54 def constructMatricNumber(self, student): 43 next_integer = grok.getSite()['configuration'].next_matric_integer44 if next_integer == 0:45 return None46 55 faccode = student.faccode 47 56 depcode = student.depcode 48 57 year = unicode(student.entry_session)[2:] 49 if student.current_mode in ('ug_pt', 'de_pt') \ 50 and student.state in (PAID, ) \ 51 and student.is_fresh: 58 if not student.state in (PAID, ) or not student.is_fresh or \ 59 student.current_mode == 'found': 60 return _('Matriculation number cannot be set.'), None 61 if student.current_mode in ('ug_pt', 'de_pt'): 62 next_integer = grok.getSite()['configuration'].next_matric_integer 63 if next_integer == 0: 64 return _('Matriculation number cannot be set.'), None 52 65 return None, "PTP/%s/%s/%s/%05d" % ( 53 66 faccode, depcode, year, next_integer) 54 55 #if student.current_mode in ('pg_ft', 'pg_pt'): 56 # return None, "SPS/%s/%s/%s/%05d" % ( 57 # faccode, depcode, year, next_integer) 58 #if student.current_mode in ('dp_ft', 'dp_pt'): 59 # return None, "DIP/%s/%s/%s/%05d" % ( 60 # faccode, depcode, year, next_integer) 61 #if student.current_mode == 'found': 62 # return _( 63 # 'Foundation programme students don\'t have matric number.'), None 64 #return None, "%s/%s/%s/%05d" % (faccode, depcode, year, next_integer) 65 66 return _('Matriculation number cannot be set.'), None 67 next_integer = grok.getSite()['configuration'].next_matric_integer_2 68 if next_integer == 0: 69 return _('Matriculation number cannot be set.'), None 70 if student.faccode in ('FBM', 'FCS'): 71 return None, "CMS/%s/%s/%s/%05d" % ( 72 faccode, depcode, year, next_integer) 73 return None, "%s/%s/%s/%05d" % (faccode, depcode, year, next_integer) 67 74 68 75 def getReturningData(self, student):
Note: See TracChangeset for help on using the changeset viewer.