Index: WAeUP_SRP/base/skins/waeup_accommodation/change_bed.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_accommodation/change_bed.py	(revision 3165)
+++ WAeUP_SRP/base/skins/waeup_accommodation/change_bed.py	(revision 3169)
@@ -46,15 +46,14 @@
         allocated_bed = res[0]
         if allocated_bed.bed_type == status:
-            logger.info('Status %s of %s has not changed' % (status,student_id))
+            logger.info('Status %s of %s has not changed.' % (status,student_id))
             psm='Student status has not changed!'
             break
             #return redirect("%s/%s/%s/waeup_document_view?portal_status_message=%s" % (students.absolute_url(),student_id,info['acco_id'],psm))
-        logger.info('Bed status %s of %s has changed to %s' % (allocated_bed.bed_type,student_id,status))
+        logger.info('Bed status %s of %s has changed to %s.' % (allocated_bed.bed_type,student_id,status))
         query = Eq('bed_type',status) & Eq('student',context.portal_accommodation.not_occupied)
         records = context.portal_accommodation.evalAdvancedQuery(query)
         if len(records) < 1:
-            psm='New bed allocation for %s failed, No bed free in category %s' % (student_id,status)
+            psm='Bed change for %s failed, no free bed in category %s.' % (student_id,status)
             logger.info(psm)
-            psm='Bed change failed!'
             break
         beds.modifyRecord(bed=allocated_bed.bed,student=beds.not_occupied)
@@ -76,5 +75,5 @@
         #acco_doc = info['acco_doc']
         #acco_doc.edit(mapping={'bed':"-- cancelled by officer due to failed bed change request --"})
-        logger.info('New bed allocation for %s failed, code = %s' % (student_id,code))
+        logger.info('Bed change for %s failed, code = %s' % (student_id,code))
         #logger.info('%s cancelled booking of bed %s by %s' % (member,bed,student_id))
         psm='Bed change failed!'
@@ -82,5 +81,5 @@
 
 info = {}
-records = [r for r in beds() if  r.student]
+records = [r for r in beds() if  r.student and  r.student != beds.not_occupied]
 list = []
 to_modify = []
@@ -91,10 +90,13 @@
         continue
     elif r.bed_type == sbt:
-        list.append("Student %s bed_type %s ok" % (r.student,r.bed_type))
+        #list.append("Student %s bed_type %s ok" % (r.student,r.bed_type))
         continue
     list.append("Student %s bed_type %s != %s" % (r.student,
                                                   r.bed_type,
                                                   info['student_status']))
-    to_modify.append((r.bed,r.student,info['student_status'],info['acco_doc']))
+    #to_modify.append((r.bed,r.student,info['student_status'],info['acco_doc']))
+    
+return "\r".join(list)
+    
 for former_bed, student, status,acco_doc in to_modify:
     beds.modifyRecord(bed=former_bed,student='')
