Index: /WAeUP_SRP/uniben/profiles/default/vocabularies/acco_special_handling.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/vocabularies/acco_special_handling.xml	(revision 3047)
+++ /WAeUP_SRP/uniben/profiles/default/vocabularies/acco_special_handling.xml	(revision 3048)
@@ -8,5 +8,5 @@
  <item key="no" msgid="">---</item>
  <item key="pg" msgid="">Postgraduate</item>
- <item key="med" msgid="">Medical (Level 500/600)</item>
+ <item key="no_med" msgid="">Medical (Level 500/600)</item>
  <item key="no_ekenhuan" msgid="">Ekenhuan Campus</item>
  <item key="no_pti" msgid="">PTI</item>
Index: /WAeUP_SRP/uniben/waeup_custom/getAccommodationInfo.py
===================================================================
--- /WAeUP_SRP/uniben/waeup_custom/getAccommodationInfo.py	(revision 3047)
+++ /WAeUP_SRP/uniben/waeup_custom/getAccommodationInfo.py	(revision 3048)
@@ -35,6 +35,6 @@
     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
@@ -57,13 +57,12 @@
                     'BENGMEP',
                     )
-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['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()
@@ -75,8 +74,8 @@
 
 booking_allowed = False
-if review_state in ('cleared_and_validated','returning','school_fee_paid','courses_registered', 'courses_validated',) and s_brain.session == session[0]:
+if review_state in ('cleared_and_validated','returning','school_fee_paid','courses_registered', 'courses_validated',) and student_record.session == session[0]:
     booking_allowed = True
-    if s_brain.matric_no:
-        res = context.results_import(matric_no = s_brain.matric_no)
+    if student_record.matric_no:
+        res = context.results_import(matric_no = student_record.matric_no)
         if res:
             booking_allowed = info['verdict'] in ("A",
@@ -88,5 +87,5 @@
 if not booking_allowed:
     info['acco'] = None
-    return info
+#    return info
 
 acco_id = 'accommodation_' + session[0]
@@ -105,34 +104,36 @@
 if review_state == "cleared_and_validated":
     bt = 'fr'
-elif int(s_brain.level) < 300:
+elif int(student_record.level) < 100:
+    bt = 'pr'
+elif int(student_record.level) < int(student_record.end_level):
     bt = 're'
-elif int(s_brain.level) < 100:
-    bt = 'pr'
-elif s_brain.faculty in ('MED') and int(s_brain.level) >= 400:
-    bt = "med"
 else:
-    res = context.portal_catalog(portal_type = "Certificate", id = s_brain.course)
-    if res:
-        c_brain = res[0]
-        #from Products.zdb import set_trace; set_trace()
-        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"
+    bt = 'fi'
+# else:
+#     res = context.portal_catalog(portal_type = "Certificate", id = student_record.course)
+#     if res:
+#         c_brain = res[0]
+#         #from Products.zdb import set_trace; set_trace()
+#         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(student_record.level)
+#         except:
+#             info["error"] = '"no level for","%s"' % student_record.getId
+#             return info
+#         if studentlevel >= certlevel:
+#             bt = "fi"
 d['sex'] = 'male'
-if s_brain.sex:
+if student_record.sex:
     d['sex'] = 'female'
-if s_brain.course in ekehuan_certificates:
+if student_record.faculty in ('MED') and int(student_record.level) > 400:
+    bt += "_med"
+elif student_record.course in ekehuan_certificates:
     bt += "_ekenhuan"
-elif s_brain.course in pti_certificates:
+elif student_record.course in pti_certificates:
     bt += "_pti"
 
@@ -142,6 +143,4 @@
 
 d['bt'] = bt
-#from Products.zdb import set_trace
-#set_trace()
 student_status = "%(sex)s_%(bt)s" % d
 info['student_status'] = student_status
