Changeset 10256 for main/waeup.kofa/trunk/src
- Timestamp:
- 30 May 2013, 18:02:31 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r10250 r10256 668 668 omit_fields = ( 669 669 'password', 'suspended', 'phone', 670 'adm_code', 'suspended_comment') 670 'adm_code', 'suspended_comment', 671 'date_of_birth') 671 672 672 673 @property … … 1223 1224 prefix = 'form' 1224 1225 omit_fields = ( 1225 'password', 'suspended', 'phone', 1226 'password', 'suspended', 'phone', 'date_of_birth', 1226 1227 'adm_code', 'sex', 'suspended_comment') 1227 1228 … … 1773 1774 note = None 1774 1775 omit_fields = ( 1775 'password', 'suspended', 'phone', 1776 'password', 'suspended', 'phone', 'date_of_birth', 1776 1777 'adm_code', 'sex', 'suspended_comment') 1777 1778 … … 2019 2020 prefix = 'form' 2020 2021 omit_fields = ( 2021 'password', 'suspended', 'phone', 'adm_code', 'suspended_comment') 2022 'password', 'suspended', 'phone', 'adm_code', 2023 'suspended_comment', 'date_of_birth') 2022 2024 2023 2025 @property -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r10249 r10256 1834 1834 self.assertEqual(td[0][0]['level'].level, 100) 1835 1835 self.assertEqual(td[0][0]['level'].level_session, 2005) 1836 self.assertEqual(td[0][0]['tickets_1'][0].code, ' COURSE1')1837 self.assertEqual(td[0][0]['tickets_1'][1].code, ' ANYCODE')1836 self.assertEqual(td[0][0]['tickets_1'][0].code, 'ANYCODE') 1837 self.assertEqual(td[0][0]['tickets_1'][1].code, 'COURSE1') 1838 1838 self.assertEqual(td[1], 3.57) 1839 1839 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') … … 1841 1841 self.assertEqual(self.browser.headers['Status'], '200 Ok') 1842 1842 self.assertTrue('Transcript' in self.browser.contents) 1843 # Officers can open the pdf transcript 1844 self.browser.open(self.student_path + '/studycourse/transcript.pdf') 1845 self.assertEqual(self.browser.headers['Status'], '200 Ok') 1846 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 1843 1847 1844 1848 class StudentUITests(StudentsFullSetup): … … 2194 2198 self.assertTrue('Course list has been registered' in self.browser.contents) 2195 2199 self.assertEqual(self.student.state, 'courses registered') 2200 # Students can open the pdf transcript 2201 self.browser.open(self.student_path + '/studycourse/transcript.pdf') 2202 self.assertEqual(self.browser.headers['Status'], '200 Ok') 2203 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 2196 2204 return 2197 2205 -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r10251 r10256 38 38 get_signature_tables) 39 39 from waeup.kofa.browser.interfaces import IPDFCreator 40 from waeup.kofa.utils.helpers import to_timezone 40 41 41 42 SLIP_STYLE = [ … … 174 175 entry_session = academic_sessions_vocab.getTerm(entry_session).title 175 176 f_text = formatted_text(entry_session) 177 f_text = Paragraph(f_text, ENTRY1_STYLE) 178 data_right.append([f_label,f_text]) 179 if not 'date_of_birth' in omit_fields: 180 f_label = _('Date of Birth: ') 181 f_label = Paragraph(f_label, ENTRY1_STYLE) 182 date_of_birth = studentview.context.date_of_birth 183 tz = getUtility(IKofaUtils).tzinfo 184 date_of_birth = to_timezone(date_of_birth, tz) 185 if date_of_birth is not None: 186 date_of_birth = date_of_birth.strftime("%d/%m/%Y") 187 f_text = formatted_text(date_of_birth) 176 188 f_text = Paragraph(f_text, ENTRY1_STYLE) 177 189 data_right.append([f_label,f_text]) … … 731 743 f_label = _('Entry Session:') 732 744 f_label = Paragraph(f_label, ENTRY1_STYLE) 733 f_text = formatted_text(view.session_dict[view.context.entry_session]) 745 f_text = formatted_text( 746 view.session_dict.get(view.context.entry_session)) 734 747 f_text = Paragraph(f_text, ENTRY1_STYLE) 735 748 contextdata.append([f_label,f_text]) … … 737 750 f_label = _('Entry Mode:') 738 751 f_label = Paragraph(f_label, ENTRY1_STYLE) 739 f_text = formatted_text(view.studymode_dict[view.context.entry_mode]) 752 f_text = formatted_text(view.studymode_dict.get( 753 view.context.entry_mode)) 740 754 f_text = Paragraph(f_text, ENTRY1_STYLE) 741 755 contextdata.append([f_label,f_text])
Note: See TracChangeset for help on using the changeset viewer.