Changeset 13440 for main/waeup.kofa/trunk/src/waeup/kofa/hostels
- Timestamp:
- 11 Nov 2015, 22:24:22 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/hostels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py
r13352 r13440 306 306 notify(grok.ObjectModifiedEvent(bedticket.bed)) 307 307 308 @grok.subscribe(IBed, grok.IObjectRemovedEvent) 309 def handle_bed_removed(bed, event): 310 """If a bed is deleted, we make sure that the bed object is 311 removed also from the owner's bed ticket. 312 """ 313 if bed.owner == NOT_OCCUPIED: 314 return 315 accommodation_session = grok.getSite()['hostels'].accommodation_session 316 try: 317 bedticket = grok.getSite()['students'][bed.owner][ 318 'accommodation'][str(accommodation_session)] 319 except KeyError: 320 return 321 bedticket.bed = None -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
r13432 r13440 145 145 self.student['studycourse'].current_session = 2004 146 146 self.student['studycourse'].entry_session = 2004 147 147 148 # The students_catalog must be informed that the 148 149 # session attribute has changed … … 435 436 self.browser.open(self.container_path) 436 437 self.assertTrue('2 of 10' in self.browser.contents) 438 bedticket.bed = self.app['hostels']['hall-1']['hall-1_A_101_A'] 437 439 # Remove entire hostel. 438 440 self.browser.open(self.manage_container_path) … … 447 449 results = [x for x in results] 448 450 assert len(results) == 0 451 # Bed has been removed from bedticket 452 self.assertEqual(bedticket.bed, None) 449 453 # Actions are logged. 450 454 logcontent = open(self.logfile).read()
Note: See TracChangeset for help on using the changeset viewer.