Changeset 13533
- Timestamp:
- 3 Dec 2015, 20:04:17 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/hostels
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
r13529 r13533 203 203 message = ', '.join(released) 204 204 self.context.writeLogMessage(self, 'released: %s' % message) 205 flash_msg = _('Successfully released beds: ${a}', 206 mapping = {'a':message}) 205 if len(released) > 50: 206 flash_msg = _('Successfully released ${a} beds.', 207 mapping = {'a':len(released)}) 208 else: 209 flash_msg = _('Successfully released beds: ${a}', 210 mapping = {'a':message}) 207 211 else: 208 212 flash_msg = _('No bed released.') -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py
r13440 r13533 227 227 228 228 def releaseBed(self): 229 """Release bed. 230 """ 229 231 if self.owner == NOT_OCCUPIED: 230 232 return … … 247 249 248 250 def releaseBedIfMaintenanceNotPaid(self, n=7): 251 """Release bed if maintenance fee has not been paid on time. 252 Reserve bed so that it cannot be automatically booked by someone else. 253 """ 249 254 if self.owner == NOT_OCCUPIED: 250 255 return … … 263 268 old_owner = self.owner 264 269 self.owner = NOT_OCCUPIED 270 sh, sex, bt = self.bed_type.split('_') 271 bt = u'%s_%s_reserved' % (sh, sex) 272 self.bed_type = bt 265 273 notify(grok.ObjectModifiedEvent(self)) 266 274 bedticket.bed = None -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py
r13483 r13533 246 246 def releaseBedIfMaintenanceNotPaid(): 247 247 """Release bed if maintenance fee has not been paid on time. 248 Reserve bed so that it cannot be automatically booked by someone else. 248 249 """ 249 250 -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
r13529 r13533 198 198 notify(grok.ObjectModifiedEvent( 199 199 self.app['hostels']['hall-x']['hall_block_room_bed'])) 200 self.assertEqual( 201 self.app['hostels']['hall-x']['hall_block_room_bed'].bed_type, 202 'regular_male_fr') 200 203 results = cat.searchResults(owner=(self.student_id, self.student_id)) 201 204 self.assertEqual(len(results), 1) … … 216 219 self.assertMatches(bedticket.display_coordinates, 217 220 '-- booking expired (2015-10-14 08:35:38 UTC) --') 221 # The owner has been removed and the bed reserved. 218 222 self.assertEqual( 219 223 self.app['hostels']['hall-x']['hall_block_room_bed'].owner, 220 224 NOT_OCCUPIED) 225 self.assertEqual( 226 self.app['hostels']['hall-x']['hall_block_room_bed'].bed_type, 227 'regular_male_reserved') 221 228 # Accommodation session can't be changed if hostels are not empty. 222 229 self.browser.open(self.manage_container_path)
Note: See TracChangeset for help on using the changeset viewer.