Ignore:
Timestamp:
25 Nov 2022, 11:54:59 (2 years ago)
Author:
Henrik Bettermann
Message:

Allow students to book accommodation also if they are in previous sessions (not activated in base package).

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  
    2828    bed_letters, blocks, SpecialHandlingSource,
    2929    NOT_OCCUPIED)
     30from waeup.kofa.students.interfaces import (IStudentsUtils)
    3031
    3132# Define a validation method for sort ids
     
    285286            return
    286287        catalog = getUtility(ICatalog, name='students_catalog')
     288        accommodation_span = getUtility(IStudentsUtils).ACCOMMODATION_SPAN
    287289        accommodation_session = getSite()['hostels'].accommodation_session
    288290        students = catalog.searchResults(current_session=(
    289             accommodation_session,accommodation_session))
     291            accommodation_session-accommodation_span,accommodation_session))
    290292        student_ids = [student.student_id for student in students]
    291293        if not bed.owner in student_ids:
    292294            raise Invalid(_(
    293295                "Either student does not exist or student "
    294                 "is not in accommodation session."))
     296                "is not eligible to book accommodation."))
    295297        catalog = getUtility(ICatalog, name='beds_catalog')
    296298        beds = catalog.searchResults(owner=(bed.owner,bed.owner))
  • main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py

    r15250 r17176  
    452452        self.assertMatches(
    453453            "...Either student does not exist or student "
    454             "is not in accommodation session...",
     454            "is not eligible to book accommodation...",
    455455            self.browser.contents)
    456456        self.browser.getControl(name="form.owner").value = self.student_id
Note: See TracChangeset for help on using the changeset viewer.