Changeset 9543 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 5 Nov 2012, 18:03:39 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r9532 r9543 745 745 form_fields = grok.AutoFields(IStudentPersonal) 746 746 form_fields['perm_address'].custom_widget = BytesDisplayWidget 747 form_fields[ 748 'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le') 747 749 pnav = 4 748 750 … … 758 760 grok.name('manage_personal') 759 761 grok.require('waeup.manageStudent') 760 form_fields = grok.AutoFields(IStudentPersonal) 762 form_fields = grok.AutoFields(IStudentPersonal).omit('personal_updated') 761 763 label = _('Manage personal data') 762 764 pnav = 4 … … 767 769 return 768 770 769 class StudentPersonalEditFormPage( StudentPersonalManageFormPage):771 class StudentPersonalEditFormPage(KofaEditFormPage): 770 772 """ Page to edit personal data 771 773 """ 774 grok.context(IStudent) 772 775 grok.name('edit_personal') 773 776 grok.require('waeup.handleStudent') 777 form_fields = grok.AutoFields(IStudentPersonal).omit('personal_updated') 774 778 label = _('Edit personal data') 775 779 pnav = 4 780 781 @action(_('Save/Confirm'), style='primary') 782 def save(self, **data): 783 msave(self, **data) 784 # XXX: Temporarily disabled until all personal forms have been properly 785 # configured 786 #self.context.personal_updated = datetime.utcnow() 787 return 776 788 777 789 class StudyCourseDisplayFormPage(KofaDisplayFormPage): -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r9532 r9543 250 250 251 251 """ 252 date_of_birth = FormattedDate( 253 title = _(u'Date of Birth'), 254 required = True, 255 show_year = True, 252 officer_comment = schema.Text( 253 title = _(u"Officer's Comment"), 254 required = False, 256 255 ) 257 256 … … 268 267 ) 269 268 269 date_of_birth = FormattedDate( 270 title = _(u'Date of Birth'), 271 required = True, 272 show_year = True, 273 ) 274 270 275 nationality = schema.Choice( 271 276 vocabulary = nats_vocab, … … 274 279 ) 275 280 276 officer_comment = schema.Text(277 title = _(u"Officer's Comment"),278 required = False,279 #description = _(280 # u'This comment will be deleted when student is cleared.'),281 )282 283 281 class IPGStudentClearance(IUGStudentClearance): 284 282 """Representation of postgraduate student clearance data. … … 295 293 296 294 """ 295 personal_updated = schema.Datetime( 296 title = _(u'Updated'), 297 required = False, 298 readonly = False, 299 ) 300 297 301 perm_address = schema.Text( 298 302 title = _(u'Permanent Address'), … … 669 673 title = _(u'Payment Level'), 670 674 required = False, 671 readonly = True,672 675 ) 673 676 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9532 r9543 2422 2422 self.assertTrue('An email with' in self.browser.contents) 2423 2423 2424 def test_student_expired_personal_data(self): 2425 # Login 2426 delta = timedelta(days=180) 2427 self.student.personal_updated = datetime.utcnow() - delta 2428 self.browser.open(self.login_path) 2429 self.browser.getControl(name="form.login").value = self.student_id 2430 self.browser.getControl(name="form.password").value = 'spwd' 2431 self.browser.getControl("Login").click() 2432 self.assertEqual(self.browser.url, self.student_path) 2433 self.assertTrue( 2434 'You logged in' in self.browser.contents) 2435 self.browser.getLink("Logout").click() 2436 delta = timedelta(days=181) 2437 self.student.personal_updated = datetime.utcnow() - delta 2438 self.browser.open(self.login_path) 2439 self.browser.getControl(name="form.login").value = self.student_id 2440 self.browser.getControl(name="form.password").value = 'spwd' 2441 self.browser.getControl("Login").click() 2442 self.assertEqual(self.browser.url, self.edit_personal_path) 2443 self.assertTrue( 2444 'Your personal data record expired' in self.browser.contents) 2445 2424 2446 class StudentRequestPWTests(StudentsFullSetup): 2425 2447 # Tests for student registration -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r9486 r9543 45 45 'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,' 46 46 'firstname,lastname,matric_number,middlename,nationality,officer_comment,' 47 'perm_address,phone,reg_number,sex,student_id,suspended,password,' 47 'perm_address,personal_updated,' 48 'phone,reg_number,sex,student_id,suspended,password,' 48 49 'state,history,certcode,is_postgrad,current_level,current_session\r\n' 49 50 50 51 'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,' 51 'Anna,Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n", '52 'Anna,Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n",,' 52 53 '+234-123-12345#,123,f,A111111,0,,created' 53 54 in result … … 65 66 'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,' 66 67 'firstname,lastname,matric_number,middlename,nationality,officer_comment,' 67 'perm_address,phone,reg_number,sex,student_id,suspended,password,' 68 'perm_address,personal_updated' 69 ',phone,reg_number,sex,student_id,suspended,password,' 68 70 'state,history,certcode,is_postgrad,current_level,current_session\r\n' 69 71 70 72 'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,' 71 'Anna,Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n", '73 'Anna,Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n",,' 72 74 '+234-123-12345#,123,f,A111111,0,,created' 73 75 in result … … 84 86 'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,' 85 87 'firstname,lastname,matric_number,middlename,nationality,officer_comment,' 86 'perm_address,phone,reg_number,sex,student_id,suspended,password,' 88 'perm_address,personal_updated' 89 ',phone,reg_number,sex,student_id,suspended,password,' 87 90 'state,history,certcode,is_postgrad,current_level,current_session\r\n' 88 91 89 92 'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,' 90 'Anna,Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n", '93 'Anna,Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n",,' 91 94 '+234-123-12345#,123,f,A111111,0,,created' 92 95 in result -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r9405 r9543 190 190 def tzinfo(self): 191 191 # For Nigeria: pytz.timezone('Africa/Lagos') 192 # For Germany: pytz.timezone('Europe/Berlin') 192 193 return pytz.utc 193 194
Note: See TracChangeset for help on using the changeset viewer.