Index: WAeUP_SRP/fceokene/profiles/default/layouts/acco_hall.xml
===================================================================
--- WAeUP_SRP/fceokene/profiles/default/layouts/acco_hall.xml	(revision 3427)
+++ WAeUP_SRP/fceokene/profiles/default/layouts/acco_hall.xml	(revision 3429)
@@ -41,6 +41,6 @@
   </property>
   <property name="is_required">False</property>
-  <property name="label">Beds for Final Students</property>
-  <property name="label_edit">Beds for Final Students</property>
+  <property name="label">Beds for NCE-3 Students</property>
+  <property name="label_edit">Beds for NCE-3 Students</property>
   <property name="help">Name the bedspaces for final year students.
                         Attention: The bed letters must not exceed the number of beds per room.</property>
@@ -55,6 +55,6 @@
   </property>
   <property name="is_required">False</property>
-  <property name="label">Beds for Fresh Students</property>
-  <property name="label_edit">Beds for Fresh Students</property>
+  <property name="label">Beds for NCE-1 Students</property>
+  <property name="label_edit">Beds for NCE-1 Students</property>
   <property name="help">Name the beds for first year students.
                         Attention: The bed letters must not exceed the number of beds per room.</property>
@@ -203,12 +203,9 @@
   <row>
    <cell name="sort_id"/>
-  </row>    
+  </row>
   <row>
    <cell name="maintenance_code"/>
   </row>
   <row>
-   <cell name="special_handling"/>
-  </row>
-  <row>
    <cell name="text"/>
   </row>
@@ -231,4 +228,7 @@
    <cell name="beds_per_room"/>
   </row>
+  <row>
+   <cell name="beds_for_pre"/>
+  </row>  
   <row>
    <cell name="beds_for_fresh"/>
Index: WAeUP_SRP/fceokene/waeup_custom/getAccommodationInfo.py
===================================================================
--- WAeUP_SRP/fceokene/waeup_custom/getAccommodationInfo.py	(revision 3427)
+++ WAeUP_SRP/fceokene/waeup_custom/getAccommodationInfo.py	(revision 3429)
@@ -35,24 +35,18 @@
     else:
         student_id = member_id
-res = context.students_catalog(id=student_id)
-if len(res) != 1:
+student_record = context.students_catalog.getRecordByKey(student_id)
+if student_record is None:
     logger.info('%s not found in students_catalog' % student_id)
     return None
 
-
-s_brain = res[0]
 info['error'] = None
-info['matric_no']=s_brain.matric_no
-info['jamb_reg_no']=s_brain.jamb_reg_no
-info['name']=s_brain.name
-info['email']=s_brain.email
-info['level']=s_brain.level
-info['end_level'] = s_brain.end_level
-info['verdict']=getattr(s_brain,'verdict','')
-review_state = info['review_state'] = s_brain.review_state
-
-
+info['matric_no']=student_record.matric_no
+info['jamb_reg_no']=student_record.jamb_reg_no
+info['name']=student_record.name
+info['email']=student_record.email
+info['level']=student_record.level
+info['verdict']=getattr(student_record,'verdict','')
+review_state = info['review_state'] = student_record.review_state
 info['session'] = session = context.getSessionId()
-
 students_object = context.portal_url.getPortalObject().campus.students
 student = getattr(students_object, student_id)
@@ -61,16 +55,25 @@
 
 booking_allowed = False
-if review_state in ('school_fee_paid','courses_registered', 'courses_validated',) and s_brain.session == session[0]:
-    booking_allowed = True
 
+# customize from here
 
-#booking_allowed = False
+try:
+    level = int(student_record.level)
+except:
+    logger.info('%s has invalid level %s' % (student_id,student_record.level))
+    info['acco'] = None
+    info['booking_allowed'] = False
+    info['student_status'] = ''
+    return info    
 
+if review_state in ('school_fee_paid','courses_registered', 'courses_validated',) and student_record.session == session[0]:
+    info['booking_allowed'] = True
+    info['online_payment'] = True
+else:
+    info['acco'] = None
+    info['booking_allowed'] = False
+    info['student_status'] = ''
+    return info
 
-info['booking_allowed'] = booking_allowed
-info['online_payment'] = True  # for Okene
-if not booking_allowed:
-    info['acco'] = None
-    return info
 acco_id = 'accommodation_' + session[0]
 acco = getattr(student,acco_id,None)
@@ -78,5 +81,4 @@
 info['acco_id'] = acco_id
 
-bt = 're'
 info['maintenance_paid'] = False
 if acco is not None:
@@ -85,38 +87,20 @@
     info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
 d = {}
-if int(s_brain.level) == 100:
+if level >= 300:
+   bt = 'fi'
+if level == 100:
     bt = 'fr'
-elif int(s_brain.level) < 300:
+elif level < 100:
+    bt = 'pr'    
+elif level < 300:
     bt = 're'
-elif int(s_brain.level) < 100:
-    bt = 'pr'
-else:
-    res = context.portal_catalog(portal_type = "Certificate", id = s_brain.course)
-    if res:
-        c_brain = res[0]
-        certificate = c_brain.getObject().getContent()
-        try:
-            certlevel = int(certificate.end_level)
-        except:
-            info["error"] = '"no end_level for","%s"' % c_brain.getId
-            return info
-        try:
-            studentlevel = int(s_brain.level)
-        except:
-            info["error"] = '"no level for","%s"' % s_brain.getId
-            return info
-        if studentlevel >= certlevel:
-            bt = "fi"
+
 d['sex'] = 'male'
-if s_brain.sex:
+if student_record.sex:
     d['sex'] = 'female'
 
 
 info['sex']=d['sex']
-
-
 d['bt'] = bt
-#from Products.zdb import set_trace
-#set_trace()
 student_status = "%(sex)s_%(bt)s" % d
 info['student_status'] = student_status
