- Timestamp:
- 7 Nov 2012, 14:09:50 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r9565 r9569 222 222 self.request.principal.id) 223 223 self.flash( 224 _('Your personal data record expired. ' 225 'Please update.')) 224 _('Your personal data record is outdated. Please update.')) 226 225 self.redirect(self.application_url() + rel_link) 227 226 return -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r9563 r9569 798 798 def save(self, **data): 799 799 msave(self, **data) 800 # XXX: Temporarily disabled until all personal forms have been properly 801 # configured 802 #self.context.personal_updated = datetime.utcnow() 800 self.context.personal_updated = datetime.utcnow() 803 801 return 804 802 -
main/waeup.kofa/trunk/src/waeup/kofa/students/student.py
r9563 r9569 37 37 IObjectHistory, IUserAccount, IFileStoreNameChooser, IFileStoreHandler, 38 38 IKofaUtils, registration_states_vocab, IExtFileStore, 39 C LEARANCE, PAID, REGISTERED, VALIDATED, RETURNING)39 CREATED, ADMITTED, CLEARANCE, PAID, REGISTERED, VALIDATED, RETURNING) 40 40 from waeup.kofa.students.accommodation import StudentAccommodation 41 41 from waeup.kofa.students.export import EXPORTER_NAMES … … 204 204 @property 205 205 def personal_data_expired(self): 206 if self.state in (CREATED, ADMITTED,): 207 return False 206 208 now = datetime.utcnow() 207 if self.personal_updated :208 days_ago = getattr(209 210 211 209 if self.personal_updated is None: 210 return True 211 days_ago = getattr(now - self.personal_updated, 'days') 212 if days_ago > 180: 213 return True 212 214 return False 213 215 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9566 r9569 1659 1659 def test_student_change_password(self): 1660 1660 # Students can change the password 1661 self.student.personal_updated = datetime.utcnow() 1661 1662 self.browser.open(self.login_path) 1662 1663 self.browser.getControl(name="form.login").value = self.student_id … … 2487 2488 def test_student_expired_personal_data(self): 2488 2489 # Login 2490 IWorkflowState(self.student).setState('school fee paid') 2489 2491 delta = timedelta(days=180) 2490 2492 self.student.personal_updated = datetime.utcnow() - delta … … 2510 2512 self.assertEqual(self.browser.url, self.edit_personal_path) 2511 2513 self.assertTrue( 2512 'Your personal data record expired' in self.browser.contents)2514 'Your personal data record is outdated.' in self.browser.contents) 2513 2515 2514 2516 class StudentRequestPWTests(StudentsFullSetup):
Note: See TracChangeset for help on using the changeset viewer.