Changeset 6998 for main/waeup.sirp/trunk/src/waeup/sirp/hostels/hostel.py
- Timestamp:
- 4 Nov 2011, 17:33:06 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/hostels/hostel.py
r6996 r6998 59 59 self._p_changed = True 60 60 removed_counter += 1 61 else: 62 self[key].bed_number = 9999 63 remaining = len(keys) - removed_counter 61 64 62 65 blocks_for_female = getattr(self,'blocks_for_female',[]) … … 94 97 if self.has_key(uid): 95 98 bed = self[uid] 99 # Renumber remaining beds 100 bed.bed_number = len(self) + 1 - remaining 101 remaining -= 1 96 102 if bed.bed_type != bt: 97 103 bed.bed_type = bt … … 102 108 bed.bed_id = uid 103 109 bed.bed_type = bt 104 bed.bed_number = len(self) + 1 110 bed.bed_number = len(self) + 1 - remaining 105 111 bed.owner = NOT_OCCUPIED 106 112 self.addBed(bed) … … 122 128 123 129 def bookBed(self, student_id): 124 self.owner = student_id 125 return 130 if self.owner == NOT_OCCUPIED: 131 self.owner = student_id 132 return None 133 else: 134 return self.owner 126 135 127 136 def switchReservation(self):
Note: See TracChangeset for help on using the changeset viewer.