Ignore:
Timestamp:
26 Oct 2012, 17:17:10 (12 years ago)
Author:
Henrik Bettermann
Message:

Fix docstrings.

In my old ZODB which I used for testing there were orphaned catalog entries. I don't know why. The tests show clearly that the catalog is updated whenever a hostel is removed or cleared. However, to be 100% that nothing goes wrong I added some extra safety belts.

File:
1 edited

Legend:

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

    r9423 r9424  
    13421342            current_session = str(student['studycourse'].current_session)
    13431343            if not student['accommodation'].has_key(current_session):
    1344                 self.flash(_('You have not yet booked a bed.'))
     1344                self.flash(_('You have not yet booked accommodation.'))
    13451345                self.redirect(self.url(self.context))
    13461346                return
     
    15891589            # If bed space has been manually allocated use this bed
    15901590            bed = [entry for entry in entries][0]
     1591            # Safety belt for paranoids: Does this bed really exist on portal?
     1592            # XXX: Can be remove if nobody complains.
     1593            if bed.__parent__.__parent__ is None:
     1594                self.flash(_('System error: Please contact the adminsitrator.'))
     1595                return
    15911596        else:
    15921597            # else search for other available beds
     
    15981603                students_utils = getUtility(IStudentsUtils)
    15991604                bed = students_utils.selectBed(available_beds)
     1605                # Safety belt for paranoids: Does this bed really exist in portal?
     1606                # XXX: Can be remove if nobody complains.
     1607                if bed.__parent__.__parent__ is None:
     1608                    self.flash(_('System error: Please contact the adminsitrator.'))
     1609                    return
    16001610                bed.bookBed(student.student_id)
    16011611            else:
Note: See TracChangeset for help on using the changeset viewer.