Index: WAeUP_SRP/trunk/skins/waeup_accommodation/formatBed.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/formatBed.py	(revision 642)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/formatBed.py	(revision 642)
@@ -0,0 +1,8 @@
+##parameters=bed
+# $Id: apply_admission.py 543 2006-09-24 07:44:32Z henrik $
+"""
+format the bed for readability
+"""
+
+hall,block,room,letter = bed.split('_')
+return "Bed %s in Room %s in Block %s in Hall %s" % (letter,room,block,hall)
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_acco.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_acco.py	(revision 639)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_acco.py	(revision 642)
@@ -19,5 +19,5 @@
 student = info['student']
 if info['acco']:
-    return student.hostal_reservation_slip()
+    return context.REQUEST.RESPONSE.redirect("%s" % info['acco'].absolute_url())
 res,psm,ds = lt.renderLayout(layout_id= 'student_acco_reserve',
                       schema_id= 'student_acco_reserve',
@@ -47,7 +47,8 @@
     s_id = ds.get('s_id')
     pin = str(ds.get('acco_res_ac_pin'))
+    
     pa = context.portal_accommodation
     code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status')))
-    if code < -10:
+    if code < 0:
         return context.reserve_acco_form(rendered = res,
                                  psm = bed,
@@ -58,14 +59,14 @@
 student.invokeFactory('StudentAccommodation',acco_id)
 acco = getattr(student,acco_id)
-ds['acco_res_date'] = current
-ds['bed'] = bed
-ds['session'] = session
+ds.set('acco_res_date', current)
+ds.set('bed', bed)
+ds.set('session', session)
 acco.getContent().edit(mapping=ds)
-return student.hostal_reservation_slip()
-return context.reserve_acco_form(rendered = res,
-                                 psm = "successfully reserved bed %s" % bed,
-                                 firstlayout = True,
-                                 lastlayout = True,
-                                 ds = ds,
-                                 )
+return context.REQUEST.RESPONSE.redirect("%s/hostal_reservation_slip" % student.absolute_url())
+##return context.reserve_acco_form(rendered = res,
+##                                 psm = "successfully reserved bed %s" % bed,
+##                                 firstlayout = True,
+##                                 lastlayout = True,
+##                                 ds = ds,
+##                                 )
 
