Changeset 17176 for main/waeup.kofa/trunk/src/waeup/kofa/hostels
- Timestamp:
- 25 Nov 2022, 11:54:59 (2 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/hostels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py
r15250 r17176 28 28 bed_letters, blocks, SpecialHandlingSource, 29 29 NOT_OCCUPIED) 30 from waeup.kofa.students.interfaces import (IStudentsUtils) 30 31 31 32 # Define a validation method for sort ids … … 285 286 return 286 287 catalog = getUtility(ICatalog, name='students_catalog') 288 accommodation_span = getUtility(IStudentsUtils).ACCOMMODATION_SPAN 287 289 accommodation_session = getSite()['hostels'].accommodation_session 288 290 students = catalog.searchResults(current_session=( 289 accommodation_session ,accommodation_session))291 accommodation_session-accommodation_span,accommodation_session)) 290 292 student_ids = [student.student_id for student in students] 291 293 if not bed.owner in student_ids: 292 294 raise Invalid(_( 293 295 "Either student does not exist or student " 294 "is not in accommodation session."))296 "is not eligible to book accommodation.")) 295 297 catalog = getUtility(ICatalog, name='beds_catalog') 296 298 beds = catalog.searchResults(owner=(bed.owner,bed.owner)) -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
r15250 r17176 452 452 self.assertMatches( 453 453 "...Either student does not exist or student " 454 "is not in accommodation session...",454 "is not eligible to book accommodation...", 455 455 self.browser.contents) 456 456 self.browser.getControl(name="form.owner").value = self.student_id
Note: See TracChangeset for help on using the changeset viewer.