Changeset 9521 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 4 Nov 2012, 08:04:15 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r9518 r9521 1400 1400 1401 1401 def update(self): 1402 if self.context.student. is_fresh:1403 self.flash(_(" You can't pay for a session below your entry session."))1402 if self.context.student.before_payment: 1403 self.flash(_("No previous payment to be made.")) 1404 1404 self.redirect(self.url(self.context)) 1405 1405 super(PreviousPaymentAddFormPage, self).update() -
main/waeup.kofa/trunk/src/waeup/kofa/students/student.py
r9517 r9521 37 37 IObjectHistory, IUserAccount, IFileStoreNameChooser, IFileStoreHandler, 38 38 IKofaUtils, registration_states_vocab, IExtFileStore, 39 CLEARANCE )39 CLEARANCE, PAID, REGISTERED, VALIDATED, RETURNING) 40 40 from waeup.kofa.students.accommodation import StudentAccommodation 41 41 from waeup.kofa.students.export import EXPORTER_NAMES … … 193 193 194 194 @property 195 def is_fresh(self):195 def before_payment(self): 196 196 entry_session = getattr( 197 197 self.get('studycourse', None), 'entry_session', None) 198 if self.current_session == entry_session: 198 non_fresh_states = (PAID, REGISTERED, VALIDATED, RETURNING, ) 199 if self.current_session == entry_session and \ 200 self.state not in non_fresh_states: 199 201 return True 200 202 return False -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9519 r9521 2199 2199 self.assertFalse(self.student['payments'][value].p_current) 2200 2200 2201 # Button and form are not available for fresh students 2201 # Button and form are not available for students who are in 2202 # states up to cleared 2202 2203 self.student['studycourse'].entry_session = 2004 2204 IWorkflowState(self.student).setState('cleared') 2203 2205 self.browser.open(self.payments_path) 2204 2206 self.assertFalse( … … 2206 2208 self.browser.open(self.payments_path + '/addpp') 2207 2209 self.assertTrue( 2208 "You can't pay for a session below your entry session" in 2209 self.browser.contents) 2210 "No previous payment to be made" in self.browser.contents) 2210 2211 return 2211 2212 -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r9519 r9521 335 335 if academic_session == None: 336 336 return _(u'Session configuration object is not available.'), None 337 # Determine fee. 337 338 if category == 'schoolfee': 338 339 try: -
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r9517 r9521 611 611 def target_url(self): 612 612 student = self.view.context.student 613 if student. is_fresh:613 if student.before_payment: 614 614 return '' 615 615 return self.view.url(self.view.context, self.target)
Note: See TracChangeset for help on using the changeset viewer.