Changeset 17176 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 25 Nov 2022, 11:54:59 (2 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
r16939 r17176 2264 2264 p_combi = [p_combi,] 2265 2265 student = self.context.__parent__ 2266 students_utils = getUtility(IStudentsUtils) 2266 2267 # The hostel_application payment category is temporarily used 2267 2268 # by Uniben. 2268 if p_category in ('bed_allocation', 'hostel_application') and student[ 2269 'studycourse'].current_session != grok.getSite()[ 2270 'hostels'].accommodation_session: 2269 if p_category in ( 2270 'bed_allocation', 'hostel_application') and grok.getSite()[ 2271 'hostels'].accommodation_session - student[ 2272 'studycourse'].current_session > students_utils.ACCOMMODATION_SPAN: 2271 2273 self.flash( 2272 _('Your current session does not match' + \2273 ' accommodation session.'), type="danger")2274 _('Your current session does not allow ' + \ 2275 'to book accommodation.'), type="danger") 2274 2276 return 2275 2277 if 'maintenance' in p_category: … … 2279 2281 type="warning") 2280 2282 return 2281 students_utils = getUtility(IStudentsUtils)2282 2283 error, payment = students_utils.setPaymentDetails( 2283 2284 p_category, student, None, None, p_combi) -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r16834 r17176 1416 1416 self.app['hostels'].accommodation_session = 2011 1417 1417 self.browser.getControl("Create ticket").click() 1418 self.assertMatches('...Your current session does not match...',1418 self.assertMatches('...Your current session does not allow...', 1419 1419 self.browser.contents) 1420 1420 self.app['hostels'].accommodation_session = 2004 … … 1439 1439 self.student['studycourse'].current_session = 2003 1440 1440 self.browser.getControl("Book accommodation").click() 1441 self.assertMatches('...Your current session does not match...', 1442 self.browser.contents) 1441 self.assertMatches( 1442 '...Your current session does not allow to book accommodation...', 1443 self.browser.contents) 1443 1444 self.student['studycourse'].current_session = 2004 1444 1445 # All requirements are met and ticket can be created -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r16966 r17176 654 654 return d 655 655 656 ACCOMMODATION_SPAN = 0 657 656 658 def checkAccommodationRequirements(self, student, acc_details): 657 659 if acc_details.get('expired', False): … … 672 674 if not student.state in acc_details['allowed_states']: 673 675 return _("You are in the wrong registration state.") 674 if student['studycourse'].current_session != acc_details[675 ' booking_session']:676 return _('Your current session does not '677 'match accommodation session.')676 if acc_details['booking_session'] - student[ 677 'studycourse'].current_session > self.ACCOMMODATION_SPAN: 678 return _('Your current session does not allow ' + \ 679 'to book accommodation.') 678 680 bsession = str(acc_details['booking_session']) 679 681 if bsession in student['accommodation'].keys() \
Note: See TracChangeset for help on using the changeset viewer.