Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py	(revision 9447)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py	(revision 9448)
@@ -127,5 +127,6 @@
                                 bed.bed_type = bt
                                 modified_counter += 1
-                                modified_beds += '%s ' % uid
+                                modified_beds += '%s, ' % uid
+                                notify(grok.ObjectModifiedEvent(bed))
                         else:
                             bed = Bed()
@@ -243,4 +244,5 @@
             message = _(u'reserved')
         self.bed_type = bt
+        notify(grok.ObjectModifiedEvent(self))
         return message
 
Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 9447)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 9448)
@@ -253,6 +253,11 @@
         results = cat.searchResults(
             bed_type=('regular_female_all', 'regular_female_all'))
-        results = [x for x in results]
-        assert len(results) == 4
+        results = [(x.bed_id, x.bed_type) for x in results]
+        self.assertEqual(results,
+            [(u'hall-1_A_101_D', u'regular_female_all'),
+             (u'hall-1_A_101_E', u'regular_female_all'),
+             (u'hall-1_B_101_D', u'regular_female_all'),
+             (u'hall-1_B_101_E', u'regular_female_all')])
+
         # Reserve bed
         self.browser.getControl("Switch reservation", index=0).click()
@@ -266,17 +271,38 @@
         self.assertTrue('Successfully switched beds: hall-1_A_101_A (reserved)'
             in self.browser.contents)
-        assert self.app['hostels']['hall-1'][
-            'hall-1_A_101_D'].bed_type == 'regular_female_reserved'
+        self.assertEqual(self.app['hostels']['hall-1'][
+            'hall-1_A_101_D'].bed_type, 'regular_female_reserved')
         self.assertTrue('<div>A_101_A</div>' in self.browser.contents)
-
-        # Change hostel configuration
+        # The catalog has been updated
+        results = cat.searchResults(
+            bed_type=('regular_female_all', 'regular_female_all'))
+        results = [(x.bed_id, x.bed_type) for x in results]
+        self.assertEqual(results,
+            [(u'hall-1_A_101_E', u'regular_female_all'),
+             (u'hall-1_B_101_D', u'regular_female_all'),
+             (u'hall-1_B_101_E', u'regular_female_all')])
+        results = cat.searchResults(
+            bed_type=('regular_female_reserved', 'regular_female_reserved'))
+        results = [(x.bed_id, x.bed_type) for x in results]
+        self.assertEqual(results,
+            [(u'hall-1_A_101_A', u'regular_female_reserved'),
+             (u'hall-1_A_101_B', u'regular_female_reserved'),
+             (u'hall-1_A_101_C', u'regular_female_reserved'),
+             (u'hall-1_A_101_D', u'regular_female_reserved')])
+
+        # Change hostel configuration with one bed booked
+        hall['hall-1_A_101_E'].owner = u'anyid'
+        notify(grok.ObjectModifiedEvent(hall['hall-1_A_101_E']))
+        hall.beds_for_fresh = ['A', 'E']
         hall.beds_for_all = ['D']
         self.browser.getControl("Update all beds").click()
-        expected = '...10 empty beds removed, 8 beds added, 0 occupied beds modified...'
+        expected = '...9 empty beds removed, 9 beds added, 1 occupied beds modified...'
         self.assertMatches(expected,self.browser.contents)
+        # Updating beds (including booked beds!) does update catalog
         results = cat.searchResults(
             bed_type=('regular_female_all', 'regular_female_all'))
-        results = [x for x in results]
-        assert len(results) == 1
+        results = [(x.bed_id, x.bed_type) for x in results]
+        self.assertEqual(results,
+            [(u'hall-1_B_101_D', u'regular_female_all'),])
         # Unreserve bed
         ctrl = self.browser.getControl(name='val_id')
@@ -348,6 +374,7 @@
         old_owner = self.app['hostels']['hall-1']['hall-1_A_101_A'].owner
         self.browser.getControl("Update all beds").click()
-        # 7 beds have been removed and re-added, 1 bed remains untouched
-        expected = '...7 empty beds removed, 7 beds added, 0 occupied beds modified...'
+        # 8 beds have been removed and re-added, 2 beds remains untouched
+        # because they are occupied
+        expected = '...8 empty beds removed, 8 beds added, 0 occupied beds modified...'
         self.assertMatches(expected,self.browser.contents)
         new_number = self.app['hostels']['hall-1']['hall-1_A_101_A'].bed_number
@@ -360,6 +387,6 @@
         hall.blocks_for_male = ['A']
         self.browser.getControl("Update all beds").click()
-        expected = '...7 empty beds removed, 7 beds added, ' + \
-            '1 occupied beds modified (hall-1_A_101_A )...'
+        expected = '...8 empty beds removed, 8 beds added, ' + \
+            '2 occupied beds modified (hall-1_A_101_A, hall-1_A_101_E, )...'
         self.assertMatches(expected,self.browser.contents)
         new_number = self.app['hostels']['hall-1']['hall-1_A_101_A'].bed_number
@@ -368,5 +395,5 @@
         # The number of occupied beds are displayed on container page.
         self.browser.open(self.container_path)
-        self.assertTrue('1 of 8' in self.browser.contents)
+        self.assertTrue('2 of 10' in self.browser.contents)
         # Remove entire hostel
         self.browser.open(self.manage_container_path)
