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

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

File:
1 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))
Note: See TracChangeset for help on using the changeset viewer.