Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py	(revision 9415)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py	(revision 9416)
@@ -360,4 +360,8 @@
     @action(_('Save'))
     def save(self, **data):
+        if data['owner'] == NOT_OCCUPIED:
+            self.flash(_('No valid student id.'))
+            self.redirect(self.url(self.context))
+            return
         msave(self, **data)
         self.redirect(self.url(self.context.__parent__, '@@manage')+'?tab2')
Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py	(revision 9415)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py	(revision 9416)
@@ -236,4 +236,5 @@
     owner = schema.TextLine(
         title = _(u'Owner (Student)'),
+        description = _('Enter valid student id.'),
         required = True,
         default = u'',
@@ -251,5 +252,6 @@
         if not bed.owner in student_ids:
             raise Invalid(_(
-                "Either student does not exist or is not in accommodation session."))
+                "Either student does not exist or student "
+                "is not in accommodation session."))
         catalog = getUtility(ICatalog, name='beds_catalog')
         beds = catalog.searchResults(owner=(bed.owner,bed.owner))
Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 9415)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 9416)
@@ -315,8 +315,15 @@
         # Managers can manually allocate eligible students after cancellation
         self.browser.open(self.container_path + '/hall-1/hall-1_A_101_A')
+        # 'not occupied' is not accepted
+        self.browser.getControl("Save").click()
+        self.assertMatches(
+            "...No valid student id...",
+            self.browser.contents)
+        # Invalid student ids are not accepted
         self.browser.getControl(name="form.owner").value = 'nonsense'
         self.browser.getControl("Save").click()
         self.assertMatches(
-            "...Either student does not exist or is not in accommodation session...",
+            "...Either student does not exist or student "
+            "is not in accommodation session...",
             self.browser.contents)
         self.browser.getControl(name="form.owner").value = self.student_id
