Ignore:
Timestamp:
9 Nov 2011, 12:40:22 (13 years ago)
Author:
Henrik Bettermann
Message:

Also relocate student if bed_type of bed has changed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r7056 r7059  
    13731373        return selectBed(available_beds)
    13741374
    1375     # This update method simulates a valid callback und must be
    1376     # specified in the customization package. The parameters must be taken
    1377     # from the incoming request.
     1375    # Relocate student if student parameters have changed or the bed_type
     1376    # of the bed has changed
    13781377    def update(self):
    13791378        student = self.context.getStudent()
    13801379        acc_details  = self.getAccommodationDetails(student)
    1381         if acc_details['bt'] == self.context.bed_type:
     1380        if acc_details['bt'] == self.context.bed_type and \
     1381                self.context.bed.bed_type == self.context.bed_type:
    13821382            self.flash("Bed category hasn't changed. Student can't be relocated.")
    13831383            return
    1384         # Search a bed and exit if no bed is found or if the student
    1385         # has already booked a bed
     1384        # Search a bed and exit if no bed is found
    13861385        cat = queryUtility(ICatalog, name='beds_catalog', default=None)
    13871386        entries = cat.searchResults(
     
    13931392                        % acc_details['bt'])
    13941393            return
    1395         entries = cat.searchResults(
    1396             owner=(student.student_id,student.student_id))
     1394        #entries = cat.searchResults(
     1395        #    owner=(student.student_id,student.student_id))
    13971396        # Rlease old bed
    13981397        try:
Note: See TracChangeset for help on using the changeset viewer.